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!
No description
No description
No description
No description
No description
No description
No description
3 Replies
clevermissfox
clevermissfox10mo ago
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.
Stroudy
Stroudy10mo ago
I think you have to reset the margin and paddingto 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
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
Let me know if that helps
Ali
AliOP10mo ago
Adding the border-boxed worked. Thank y'all for your help!
Want results from more Discord servers?
Add your server