F'ups set to c.i.w.a.s
Also, this universal selector rule
* {
margin: 0;
padding: 0;
}
is a clear sign of over-declaring, over-defining. The use of the
universal selector is very rarely recommendable and is discouraged by
many CSS gurus.
But not all.
By removing all margin and padding on all elements, you are later
force to add them back almost everywhere (for almost all elements like
p, li, headings, etc) instead of relying on browser default
declarations. I personally never do that and I certainly do not
encourage that practice because it invariably lead to over-declaring,
over-defining.
Being later forced to add spacing back to elements is one of the reasons
Eric Meyer *likes* it (see his "Reset Reloaded" article at
<
http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/> with some
more of the reasoning behind it at
<
http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/> ),
although he does specifically say he doesn't like the * universal
selector, he does do this:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
etc.
While I see his reasoning, I'm not yet persuaded I want to do this for
every page/site I do. But then, I'm not a CSS guru, so maybe my lack of
experience keeps me unenlightened. So like you, Gérard, I never do it
either.
Other discussions of the "reset all" philosophy can be found via an
article called "CSS Frameworks + CSS Reset: Design From Scratch" at
<
http://www.smashingmagazine.com/2007/09/21/css-frameworks-css-reset-design-from-scratch/>
, although that page is best visited with CSS (and JS) turned off.
Ironically enough, with CSS enabled, the page takes forever to load and
respond to scrolling. (Disabling JS just keeps the ad count down.)