If you were to create a bare minimum XHTML document, with no CSS applied, and fill it with various elements (a few paragraphs, a heading or two, etc), you’ll notice that web browsers have default formatting for everything. Paragraphs have a certain amount of space between them, the body tag has default padding, etc.
This, of course, introduces cross-browser issues. Each browser has it’s own default styling, and they’re all different. So in order to make your CSS work well in more than one browser, it’s generally best to unset the default styles witth a browser reset stylesheet, or section in an existing stylesheet.
Rather than write one here and tell you to copy and paste it, since not all resets are equal, I’ll instead offer you a selection of links where you can find CSS reset styles. Choose one that fits your needs.
- YUI Reset CSS
- Reset Reloaded
- Here’s one I often use. I can’t remember where I originally found it though, so I posted it on Pastebin.
- CSS Frameworks + CSS Reset: Design From Scratch
- Weekend Quick Tip: Create Your Own Simple Reset.css File