I recently started HTML with a Glitch website (very good stuff btw ) and tried to use the <header> HTML tag on my website. Nevertheless, I get a weird space around the header letting my background through. Why is that so?
No, it definitely won’t. What you need to do is set the body margin to 0, and create a separate div for the content below the header. After that, just set the margin of the div to whatever you want, and it will work perfectly.
Also chrome has this lovely tool showing how margin gets applied after the border which is applied after padding. If you think about it, the background should not apply outside the border so using margin will not keep your background styling. However if you go to the parent element (the one that contains the element) and set the color that background will show up at the margin