Cross-browser Compatibility

Posted in: Crowd Favorite, Tasks Pro™, Development, Technology

Note: this is one of a series of posts about the creation of the King Design web site.

Anyone who has developed a pure CSS layout with any amount of complexity is well aware of cross-browser quirks and limitations. Not all browsers have implemented CSS to the same degree or in the same way - it’s just a fact of life for web developers. While I try to use mainstream techniques as much as possible, there are times when I need to give certain browsers :scare: special :/scare: treatment.

The technique I use is to have one main stylesheet that works in most modern browsers, then load additional stylesheets for :scare: problem :/scare: browsers. Generally, I need to override a few classes for IE 5.5/5.0, Opera, and the occasional Safari issue.

CSS rules are applied in the order they appear in the stylesheet and the order the stylesheets are loaded. If you load your main stylesheet first, then load a browser-specific stylesheet afterward (with some of the same CSS selectors but different definitions) the definitions in the second stylesheet will override the ones defined in the main stylesheet.

Incidentally, I use the same technique to handle themes in my Tasks Pro™ and Tasks software. The base style information is loaded then, if the user has a different theme chosen, a theme stylesheet is loaded that overrides some of the base style information.

Popularity: 5% [?]

Posted March 25th, 2005 @ 12:50 AM

5 Replies

  1. fuzzy_logic adds this Comment:

    I load a special stylesheet for IE and a common one for everything else.

    March 25th, 2005 at 8:52 am

  2. priss adds this Comment:

    Do you do anything for IE5 on Mac? IF so, what?

    I’ve gotten to the point of not supporting IE5 for mac if it’s a personal (i.e. blog) site unless specifically requested and/or paid for…because it’s such a pain.

    March 25th, 2005 at 2:29 pm

  3. Alex adds this Comment:

    Microsoft doesn’t support IE Mac and neither do I (though I’ve actually found it handles more than I expected).

    March 25th, 2005 at 2:30 pm

  4. JamesZ adds this Comment:

    i use the techniqe that Doug Bowman uses on Stopdesign.com. Check out his source. It works beautifully but is a little complicated to understand exactly how it works at first.

    March 27th, 2005 at 1:03 am

  5. Alex adds this Comment:

    That’s exactly the mess I avoid by loading browser specific stylesheets. :)

    March 27th, 2005 at 1:22 am

Add a Comment

Please note: Use of a non-personal web site or blog in the field below and/or comments that are off-topic, personal attacks, or support requests will likely be removed at my discretion.

Note: This post is over 3 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

8 Hours Left in Theme Competition » « WordPress (as CMS) Hacking Tips

About This Site

This is the personal web site of Alex King, an independent developer based in Denver, Colorado USA. More...


Crowd Favorite

Crowd Favorite is my software and web development business.

We build web applications, design and develop custom WordPress themes and plugins, and build custom sites using WordPress as a CMS.


I also have a tumblog that aggregates my online content from other services (Twitter, Flickr, del.icio.us. etc.).

I'm voting for Barack Obama

Ads