Starting clean with CSS

When working on a new site, the difference between browsers became clear again. This time I’m not talking about bugs that occur on one version or the other, but the defaults each browser has.

Every browser, be it IE, Firefox, Opera or other… has its own defaults, especially borders, margins, paddings and font-sizes. Because of that, when you start with a new CSS file, it’s best to reset those, like this:

* {
margin: 0;
padding: 0;
border: none;
}
body {
font-size: 62.5%; /* Resets 1em to 10px */
} 

This will be a little more work in the beginning, because you need to set every tag’s margin and padding as you like it, but it’ll save you a LOT of time later on, when you’re trying to find why one browser doesn’t render your content as you wanted.

No Responses to “Starting clean with CSS”.

Comments are closed.