Starting With a Clean Slate

You may not know that every browser has its own default settings for margin, padding, and border on various elements such as <p> and <img>. These settings can interfere with your design and create inconsistencies across various browsers. The key to preventing this is to start every stylesheet cleanby beginning your stylesheet with this declaration:

* { margin:0; padding:0; border:none; }

The star (or asterisk) is the CSS universal selector. Think of it as a wild card. Used on its own, it represents every element on a page. Every single one, from "html" all the way down to the smallest "br."

If you've ever designed a website without this declaration, you've probably noticed slight inconsistencies in the final product across browsers. This will, in most cases, eliminate that, and put you in control of your design. It will also save you the trouble of applying these values to individual elements later on.