Trying to make a header touch the top of my page, however there seems to be an automatic margin, even if specified otherwise.
I've tried specifying margin-top: 0
, and have set margin: 0
to the body as well.
h1 {
margin-top: 0px;
}
body {
margin: 0px;
}
<h1>test</h1>
Instead of touching the top of the page, the "test" header has an automatic margin at its top.
adding line-height: 75%;
seems to do the trick:
h1 {
margin-top: 0px;
line-height: 75%;
}
body {
margin: 0px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With