My two favourite word in the English dictionary… DE-FAULT!

Well, no actually, they’re not.

They’re bad, real bad. Whether it be a default font face or default colour, it’ll make the average design sneer. Same goes for a coder. Unfortunately, with CSS, we’re dealt a large hand of default values that different browsers treat slightly differently. I’m looking at you, Internet Explorer.

A good solid CSS design/programming practice is to reset these values to a more common(sense) set of values. This eliminates random behaviours later in a project and can save you literally hours of time because you don’t have to track down the cause of odd behaviour. By creating a set of basic rules for all elements to follow, you’re creating a rule-set that each browser will follow, and produce the same set of results from the word go. No extra padding here, no sneaky margins appearing from nowhere.

Not everyone uses a default set all the time, I’m guilty of this too, but it’s something I’m starting to address and think it’s worthwhile writing about, as 5 minutes of my time might save you an hour. Jobs-a-goodun.

So, rather than me try to list a half-arsed set of defaults, I direct you to Eric Meyer, whose written what he considers to be his “final” version of a reset for CSS.

Comments 1

  1. Gareth Heyes wrote:

    I think the global wildcard is worth mentioning as well.

    * {
    }

    You can reset everything with this and it also allows table * {} etc

    Posted 02 May 2007 at 11:03 am

Post a Comment

Your email is never published nor shared. Required fields are marked *

Comment spam protected by SpamBam