By Peter Bell

CSS: Reset Reloaded

What do YOU think of CSS snippets like Eric Meyers reset script? (Smashing magazine has a list of some others at the bottom of article). Do you create your own resets? Are there any other snippets you consistently put into your CSS? Do you have a mini in-house framework you'd be willing to share some of the ideas behind?

Thoughts?

Comments
I like:
- that he uses one (mostly because I do as well)
- that it's more considered and selective than the classic * { padding: 0; margin: 0; }

I don't like:
- Removing the :focus outline. I understand his reasoning, but don't agree with it. It's a usability thing and I don't think seeing nothing would remind me of anything, personally. That may be more my problem than the script's, though. :-)
- Defaulting the list-style to none. Unless you use lists exclusively or primarily for navigation or other "non-traditional" blocks.

The "don't likes" are minor and easily changed so, on the whole, I like it. Resets are a great tool when they're discriminating in what they reset, I think.
# Posted By Rob Wilkerson | 9/28/07 7:41 AM
I was so unaware of it that I had to go read the first in the series to find out what a "reset" was.

In any case, it seems to be treating the web as print. In most cases, I'd just let the browser do its job. If it looks horrible I'll fix it.

But then again, they don't pay me to be a designer, so what do I know?
# Posted By Sammy Larbi | 9/28/07 8:13 AM
I think both of the previous commenters miss the point of reset.css.

Although I think Meyer's reset is somewhat better, the <a href="http://developer.yahoo.com/yui/reset/">YUI page on reset.css</a> gives a good explanation of what this is for. Yes, a site that applies reset.css and nothing else will have usability problems. The point is that you need to specify your own default styles for lists, focus outlines, and anything else you want; you give up the idea that the browser is going to style those things for you. What you gain is consistency across browsers

Each browser has a default stylesheet (which you can't easily see) and there are subtle differences between these stylesheets; if you start with reset.css you eliminate many of the differences between the default stylesheets. An example of this is list styling-- if you let the browser style your lists, there will be big differences in the padding of nested list items between firefox and IE. If you include reset.css, then supply your own list padding styles, you'll get consistency.

I also find that reset.css makes troubleshooting style issues using tools like Firebug a lot easier. (It amazes me that some people can do CSS without using Firebug's document inspection tools).
# Posted By David C-L | 9/28/07 8:29 AM
CSS Reset has been an essential tool for me for quite some time now - I wouldn't be without it.
# Posted By Tom Lee | 9/28/07 9:16 AM
David - I completely get the purpose of it. What I don't understand is why someone would care enough to use it.

The slight differences that I'm able to notice don't bother me - but most designers I've worked with design with that in mind, perhaps (including anything I've done). I just don't think that web designs need the pixel-perfect design control you'll find you need in print publication design (which is what doing such a thing reminds me of).
# Posted By Sammy Larbi | 9/28/07 10:06 AM
The problem with reset's is they are more geared to web sites that reapply images or styles again to all those elements and just want them reset in one place. I build web applications. I've built CMS's and other apps. I need for example lists to appear as lists. I don't want to go through the trouble of reseting everything and then setting it back again. An example of this would be using YUI's reset.css and then there base.css. What I believe in is Visual Consistency. I'll remove margin and padding on specific elements (much like YUI does their's) but I don't on some form elements for example. Some form elements are very hard to style and I prefer to leave the way they are. Once you start removing margin and padding on form elements some become unreadable. Resets have their place but I think they go to far in the sense that they remove all default styles when majority of the time I want those in place. What mainly is the most inconsistent between browsers is spacing (margin and padding).
# Posted By Javier Julio | 9/28/07 10:09 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.