CSS Margins Help
Hello All, I'm still learning the basics of CSS and am having trouble with my code. Forwhatever reason my main title page that says "PergolaLuxe" has a top and bottom margin, as shown when inspected. I for the life of me cannot find why this is occuring within my code. Any advice is appreciated. Thanks in advance!
3 Replies
Can you paste this into a live sandbox like https://codepen.io, there are some styles in a screenshot that are not shown in the dev tools so it’s hard to tell what’s going on. Html elements have defaults margins and padding , this behaviour is often why it’s common to include *{margin:0;padding:0;} in the css reset. May also be a specificity issue between id selectors and class selectors.
I think you have to reset the
margin
and padding
to 0 and its also a good idea in the future to use box-sizing
. If you apply this to the top of your sheet it should reset it
Let me know if that helpsAdding the border-boxed worked. Thank y'all for your help!