Different browsers have different default settings for page elements. In an effort to keep web pages looking as consistent as possible between browsers, many web designers use what is commonly referred to as a CSS reset to wipe away these default settings and start fresh.
Margin and padding are the most common things to reset as they commonly cause layout problems if not reset. This also gives you the opportunity to “work forwards” with your margin/padding. This means applying margin/padding only to elements which need it instead of removing it from elements that don’t. This can often makes more sense for designers and can lead to trimmer code. Border is another popular thing to reset as it can take care of problems with those pesky borders around linked images. This can cause problems with borking* default styling for things like submit buttons that you didn’t intend to bork.
Eric Meyer offers a popular reset and the star selector reset also enjoys some popularity. Both of these styles have their advocates and critics.
So how about it folks: What kind of CSS Reset Do You Use?
Do you use one of the popular ones? Have one of your own design? Do you use one at all? The voting widget is down in the sidebar as usual (RSS readers will have to make the jump to vote, still haven’t figured that one out).
*Official term for screwing something up with CSS that you didn’t intend to.
How about adding the YUI or Blueprint reset to the poll?
Added.
I’m trying to get back in the swing of things after not coding for quite some time. I was a hack then, and not much better now, though you’ve been a nice source of needed info for me.
After being put into action on a family member’s business site, I was bugging out over I.E. problems (what’s new). I came upon the “Hard Reset” solution and was floored by how almost everything snapped into place; amazing! After further reading and a hope to see even further magical “snapping”, I came upon Eric’s reset and am working with that. I didn’t notice any additional effects when I switched out resets, but I think there are probably some benefits that I haven’t noticed, or will reap, as I develop the entire site.
Thanks for the excellent blog, by the way.
For the most part I am using my own, but I just tried the blueprint Typographic file and it really made life easier.
I never heard of a css-reset before….
I settled with Eric Meyer’s CSS Reset and it works quite well.
I used to use a hard reset which included
body * {margin:0;padding:0}
But when you come to override this style you end up having to refer to the
body
again to change what you set, you may have also noticed that CSS hacks have a similar effect on the cascadeI’m using Eric Meyer’s reset styles. I was a bit skeptical at first, mainly because I didn’t really see the use for it. However I gave it a try and I can tell you it truly cuts down on production time…
i only reset the parts that need to be reset, all those css frameworks have to much lines or css that i dont even use… which means bigger file.. longer loading. :)
@Colin & Chris: the Blueprint framework uses Meyer’s reset … so no need to add it to the poll ;-)
see: http://meyerweb.com/eric/tools/css/reset/
You can’t go wrong with the latest Meyer’s reset. ;)
I prefer to use one of Meyer’s resets (his Reset-page: http://meyerweb.com/eric/tools/css/reset/). Preferably the latest one, with some small adjustments. There are elements that I don’t use on a regulary basis or due to DTD restrictions, such as: strike, var, center, samp, address and del. Although I see uses for alot of them, I don’t need them as much as the rest.
I have my own reset.css file, which I got some flack for. As much as ‘*’ may not be “best practice”, it always works.
http://davidwalsh.name/advanced-css-using-a-resetcss-file-to-gain-complete-control/
Eric Meyer’s original reset. I have yet to update to his latest version.
I am still skeptical about using all this extra code for resetting css resets…
I only reset when needed. As I’ll probably set my own properties to most elements, I often find resetting useless.
* has proven very useful for general margin and padding resetting, but I also like to ensure tables and img being taken care off. depending on project it gets more involved – meyer’s reset of course is a great one but often more than I currently need.
Interesting question.. I tend to use a variation of the Meyer reset, but also use others depending on the design. Perishable Press has a great collection of popular CSS reset styles. Lots of choices, including the Meyer reset. Cheers!
Thanks for that link August! I hadn’t seen that before, I’ll mention it in the poll results post later this week.
I’m a bit of a noob… Can someone explain exactly what a reset is? Does it override browser defaults that otherwise make styling a pain? I’m reluctant to use it since I’ve very little clue as to it’s use and I’m afraid I’m missing something beneficial.
I start with the condensed version of Meyer Reset. Normally I remove or tweak something.
Chris, reset is very much reset (border, padding, etc.). User agents — manly browsers, but not only — have lots of properties like these set by default. It about get rid of it and start from scratch. It is crucial to maintain digital documents consistent across different user agents.