I was trying to get my header background image to reach the top of the viewport. There was a gap between the top of my image and the top of the viewport, and I wanted to fix it. I tried applying a margin to my <header>
css, but this did nothing. What DID end up working was applying padding.
header {
text-align: center;
background: url("https://i.imgur.com/E4yIQba.jpg");
background-size: cover;
color: white;
padding: 1px 0px 0px 0px;
}
Everything looks good now, but does anyone know why adding 1px of PADDING to the top of the image resolved the issue, while attempting to add a MARGIN of 0px(margin: 0px 0px 0px 0px) did nothing? I thought margins were supposed to move elements closer and farther away from the edges of viewports. I am surprised that padding resolved my issue instead of margin. Thanks!
https://dash.generalassemb.ly/docmp0/build-your-own-blog-theme