Forum : load different css for different browsers
Brief description  about Online courses   join in Online courses
View Noor  Mohammed 's Profile

load different css for different browsers

Hello sir,

Could you please give the code to load different CSS for three different browsers (Firefox, IE, oprea). I tried this code but I am unable to get it working.

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="styleie.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="styleie.css" />
<![endif]-->
<[if !IE]>
<link rel="stylesheet" type="text/css" href="style.css" />
<[endif]>

Many thanks regards.
Asked by Noor Mohammed | Dec 15, 2010 |  Reply now
Replies (2)
View teacher siliconindia 's Profile
for IE browsers, u need to put condition.
Dec 22, 2010
View teacher siliconindia 's Profile
Hi Noor,

The above posted code is correct to load different css for different browsers. don't use this,
<[if !IE]>
<link rel="stylesheet" type="text/css" href="style.css" />

u simply include the css for other browsers in head section. only for IE, u need to concentrate.
Dec 22, 2010