Some very simple html:
<header class="my-header">
<div class="no-margins">
<p>Nicolay Copy</p>
</div>
</header>
And css:
.my-header {
position: sticky;
top: 0;
margin: 0 0 0 0;
background-color: white;
z-index: 1;
}
.no-margins {
margin: 0 0 0 0;
}
Here's the F12 computed for the containing <div>
And here's the F12 computed for the contained <p>
.
Shouldn't the margins for <p>
be inside the <div>
? Obviously they aren't, but why?