When we set CSS values we are over-riding many defaults that are set by the browser (or the “user agent”, more specifically). If we want total control of how a page is displayed we can use a “reset” technique to ensure that we override all if not most default values using the * selector:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}This becomes more evident as we begin to think about CSS using the CSS Box Model.
Note that the border-box is not the default setting - content-box is. The difference is the how the box model is calculated: with border-box a width, for example, of 400px will be 400 units including border, padding, and content (note that the margin is outside the border so it is not included. In content box, only the content will be 400px + extras for everything else, making it sometimes rather difficult to measure and style things.