Sometimes it is better to create alternate css files for different browsers (esp. IE), than using hacks. It is important in big projects, when client requires the site to be fully cross-browser. The basic technique to attach an IE-Only stylesheet is using the HEAD section conditions:
CSS FILE LOADED FOR BROWSERS OTHER THAN Internet Explorer:
<![if !IE]>
<link rel=“stylesheet” type=“text/css” href=“NOT-IE.css” />
<![endif]>
IE 6 ONLY CSS FILE:
<!??[if IE 6]>
<link rel=”stylesheet” type=”text/css” href=”IE-6-SPECIFIC.css” />
<![endif]??>
IE 5 ONLY:
<!??[if IE 5]>
<link rel=”stylesheet” type=”text/css” href=”IE-5-SPECIFIC.css” />
<![endif]??>
IE 5.5 ONLY:
<!??[if IE 5.5000]>
<link rel=”stylesheet” type=”text/css” href=”IE-55-SPECIFIC.css” />
<![endif]??>
VERSION OF IE VERSION 6 OR LOWER: (I find this one pretty handy)
<!??[if lt IE 7]>
<link rel=“stylesheet” type=“text/css” href=“IE-6-OR-LOWER-SPECIFIC.css” />
<![endif]??>
IE 7 ONLY:
<!??[if IE 7]>
<link rel=“stylesheet” type=”text/css” href=“ie7.css” />
<![endif]??>
The biggest advantage of using this methos is that it passess W3C validation and you don’t have a mess of different hacks in your css code.
Filed under: css | Tagged: web designing company bhubaneswar, web developer bhubaneswar, Web Developer designer in Bhubaneswar, Web Development, web site design bhubaneswar, website designing auckland, website designing bhubaneswar, website designing new zealand | Leave a comment »