I am getting an unwanted top margin for an h1 element, not sure why. This is my html:
<body>
<div class="content">
<h1>Header</h1>
<p>Paragraph 1.</p>
<p>Paragraph 2.</p>
<p>Paragraph 3.</p>
</div>
</body>
This is my css:
body {
background-color: yellow;
padding: 0px;
margin: 0px;
}
h1 {
background-color: lime;
}
.content {
background-color: pink;
position: absolute;
left: 0px;
top: 0px;
padding: 0px;
margin: 0px;
}
the result:
I was expecting the h1 element to be aligned with the top edge of the view.
If I remove the "position", "left" and "top" attributes from the css def, then the h1 element aligns to the top of the view as expected:
why is that happening? I'm using chrome.
Thanks