Why does the margin of the last element, whether it is a <p>
or <h1>
, not have any impact?
It should be pushing the background of the parent container downwards.
.container {
background: grey;
}
h1 {
margin-bottom: 3em
}
p {
margin-bottom: 5em
}
<div class="container">
<h1>Title</h1>
<p>Content.</p>
</div>