Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative style sheets based on browser

Anyone out there know if its possible to have a javascript figure out what browser a page is being used in and load a stylesheet accordingly. Ideally I would like to have a different sytlesheet for each browser and css media queries only go so far right now.

like image 868
DWLynch Avatar asked May 29 '26 23:05

DWLynch


1 Answers

If you are trying to hit IE versions only, Conditional comments works quite well!

http://www.quirksmode.org/css/condcom.html

If you want to target browsers for there abilities use Modernizr:

http://www.modernizr.com/

If none of the above you should look in to browser detection:

http://www.w3schools.com/js/js_browser.asp

like image 64
Allan Kimmer Jensen Avatar answered Jun 01 '26 11:06

Allan Kimmer Jensen