Skip to content

Instantly share code, notes, and snippets.

@vitkarpov
Created August 22, 2016 15:25
Show Gist options
  • Save vitkarpov/90d7858b0ecbe80c34d84322faa06fb2 to your computer and use it in GitHub Desktop.
Save vitkarpov/90d7858b0ecbe80c34d84322faa06fb2 to your computer and use it in GitHub Desktop.
Untitled
.wrapper {
background: red;
}
.wrapper:after {
content: '';
display: table;
}
.inner {
margin: 20px 0;
}
<div class="wrapper">
<div class="inner">Сверху маргин торчит за родителя, а снизу — включается в него, благодаря тому, что табличка в конце контейнера создает новый контекст форматирования, через который маргин торчать не может.</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment