CSS Resets to improve website its browser compatibility
Author: Stefan Vervoort | Published: 11 March 2008 | RSS | LINK
Font size: 

A couple years back a revolution began against the ugly websites with tables. Many people adapted the use of XHTML with the mark-up language CSS. These steps drastically improved the web, but unfortunately, the developments are too good to be true.
Why? Because we live in a web-world where browsers define the look of many CSS properties. Modern browsers like Firefox, Internet explorer, Opera, Safari, Netscape and all the others have generalized their own rules. Usually, a webdesigner can’t pay attention to all the rendering rules of all those different browsers, so usually a website will not look the same on every computer.
Have people been talking about this? Ofcourse, lots of. A lot of CSS developers didn’t want to use any CSS styles they didn’t specificy in their CSS file, so they started to use “CSS Resets”. They included lines of CSS in the beginning of their file to clear their website of unwanted CSS declarations. It worked and lots of CSS reset variants have entered the CSS developer scene ever since.
I will show you some and explain them to you.
A couple populair CSS-Resets
Simplest
This reset I used to use is the most simple on available. It resets the border, padding and margin to zero on every element HTML contains.
*{ padding:0; margin:0; border:0; }
Normal
When I was researching this topic, I found this interesting CSS Reset, which I think is the best available. It covers the basic aspect every website needs and absolutely nothing more, which is great for your optimized CSS files as well.
* { border: 0; padding: 0; margin: 0; vertical-align: baseline; font-weight: inherit; font-family: inherit; font-style: inherit; font-size: 100%; }
Other, more extensive resets
Eric Meyer’s reset - This is a very extensive reset, it covers everything! It is one of the most populair reset available.
Yahoo!’s Reset - Another large reset, which in my opinion is too big and is covering too many elements most CSS developers will not use in a normal website.
Rik Lomas’ Reset - Rik created a standard CSS reset file, but an optimized file as well. Great to reset everything and make sure your webpage loads fast as well.
I am sure there are more CSS reset files out there, but I think this list covers the most important parts. You have seen sizes vary on complexity. I hope you are going to use CSS resets to make sure your website use the standard CSS rules in every browser. In the end, this will speed up your designing process.
Thanks for reading.
4 Comments
Leave a Reply
This blog is a DoFollow blog. This means your URL counts as a backlink. Some basic HTML is allowed. Please keep all comments constructive, polite and on-topic. Any spam or offensive comments will be deleted.









2:27 pm on July 2nd, 2008
Useful article. Sometimes things that haven’t been properly resetted can become really pain in the ass.
Thanks
8:23 pm on July 15th, 2008
Grammar and spelling…oh how I miss them.
10:32 pm on August 18th, 2008
These are some great examples of CSS resets. The Meyer reset is exceptionally keen. I recently put together a reference featuring a ton of widely used CSS resets. Hopefully it will further help you and your readers
Cheers!
8:17 am on August 19th, 2008
@Jeff - You really have a great collection there! I think the visitors who read that are interested in your collection, and I will link to the article in a link-roundup. Thanks for commenting Jeff!