Browsers give elements default styles, including margins. A reset style sheet clears some of those choices so you can set the spacing yourself. Think of it as clearing the table before arranging everything where you want it. section 9.5 section 19.10
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
This compact reset uses the universal selector, `*`, to apply three declarations to every element: remove margins, remove padding, and set `box-sizing` to `border-box`. Put it near the top of your style sheet, before adding your own spacing. section 9.5 section 19.10
A reset is a starting point, not a finished design. With margins set to zero, a navigation bar can sit tight against the window edges and the text below it. Add margins back where the layout needs breathing room. section 9.5
Give the spacing back
After resetting, give a navigation list its own top, right, bottom, and left margins; give the content below it left and right margins. The browser no longer decides those gaps for you. An initial portfolio-page reset similarly sets margin and padding to zero and font size to 100% before the page layout is styled. section 9.5 section 20.5
For a larger project, a professional reset such as Normalize.css is another option. The important reminder: once you remove default spacing, remember to supply the spacing you actually want. section 9.5
