I can’t seem to figure out why my “welcome section” is not vertically centered. I’m assuming there are some default margins I’m not taking into account but I cannot figure out what.
Here is a link to my codepen:
https://codepen.io/fsuffieldcode/pen/VJEeBv
Thanks in advance for any help.
Hi, I think the default margins come from the h1
tag, which are
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
You can try overriding them to see if it helps
You forgot the slash on the closing h1 tag (</h1>
), you also have a negative margin-bottom on the h1.
Thanks very much. Turns out I forgot to close my h1 tag, as per @lasjorg
You found it. Thanks so much! The negative margin was just something I was playing with to try and figure it out.