Jump to content

Archived

This topic is now archived and is closed to further replies.

AdRock

Browser detection and appropiate CSS

Recommended Posts

I am trying to find an example of a simple browser detection script thats checks the users browser and calls the right css stylesheet.

As everyone knows Firefox and IE displays content differently I am looking for a solution to create a stylesheet for both browsers and the browser detection would decide which style sheet to link to.

Is there any simple scripts out there that can do this job?

Share this post


Link to post
Share on other sites
[quote author=AdRock link=topic=104327.msg416063#msg416063 date=1155638449]
As everyone knows Firefox and IE displays content differently ...
[/quote]

Sweeping generalizations like that don't help.  All of the sites I've worked on have used a single CSS stylesheet that works with IE, FF, Moz, and Opera and which complies with the W3C standard.  If you want to use CSS declarations that are unsupported by a particular browser (and that's your decision) then conditional CSS makes more sense and is much easier to maintain than separate stylesheets for different browsers. 

http://www.stylegala.com/articles/no_more_css_hacks.htm is worth a read.

http://www.thinkvitamin.com/features/css/stop-css-hacking, also worth a read.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.