A trendy topic amongst CSS’ers is the CSS reset. The idea is that you intercept the default browser stylesheet (that is used first in the cascade), reset, and then apply generic styles including margin/padding. I read many articles by many gurus, but I eventually came out with what I have below.
For differing implementations check out this great “killer collection” of resets, and note that this won’t work in IE6 due to the universal selector but I’m ok with that.
/* Reset Default Browser Styles - Place first in the listing of external style sheets for cascading. - Be sure to explicitly set margin/padding styles. - Styles are not reset that have to do with display (block, inline) are not reset. By: Chris Poteet & various influences */ * { vertical-align: baseline; font-family: inherit; font-style: inherit; font-size: 100%; border: none; padding: 0; margin: 0; } body { padding: 5px; } h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, ul, ol, dl { margin: 20px 0; } li, dd, blockquote { margin-left: 40px; } dt { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; }
Thanks for the link, Chris! I finally got around to updating my collection with your CSS reset. Great work!
Thanks Jeff!