Jump to content

Browser detection and appropiate CSS


AdRock

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?
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.