Forum : css versions, hacking and cross browser isses
Brief description  about Online courses   join in Online courses
View Nagashesh  Kote 's Profile

css versions, hacking and cross browser isses

I want to know about css versions, css hacking, cross browser issues with css, star html hack. Please provide me more info on this.

Thanks
Asked by Nagashesh Kote | Dec 13, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
<link href="homeoutside/formozilla.css" rel="stylesheet" type="text/css" />
<link href="homeoutside/forie.css" rel="stylesheet" type="text/css" />
<link href="homeoutside/forie7new.css" rel="stylesheet" type="text/css" />


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

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


We use the above code to overcome the browser compatibility issue.

How it works is. We have 3 different style sheets for IE6, IE7 and Mozilla.

First style sheet "formozilla.css" will work as the master style sheet. If you need any changes to be made in the master css file to adjust IE6 or IE7 just add the same id in the css file for IE6 and make the style change there.

So when the browser reads if that browser is IE6 it will compare both the style sheet, master style sheet and the IE6 style sheet. So if the browser find any change in the CSS file for IE6 it will take that particular style.

The beauty is Mozilla's style sheet will work for all other browsers other than IE. But IE6 style sheet wont work for IE 7 also. Hats off to microsoft :-)
Jan 10, 2011