Quote:
Originally Posted by digitaloverlay
As the title indicates, I am having some problems with ie (who isn't). I am creating a CSS layout and see that my layout isn't the same for FF and IE so I wanted to make one for IE to be called if the user is using that browser. After searching the web I found the hack to implement this but it isn't working.
This one is for greater than or equal to ie 6.
<!--[if gte IE 6]>
<link rel="stylesheet" type="text/css" href="iespecific.css" />
<![endif]-->
One for ie 6 only.
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iespecific.css" />
<![endif]-->
|
Seems like you're doing it correctly. Make sure your order is correct, as in list a css file you always want first, then add additional files after. Each additional file includes *only* css overrides that pertain to the browser of interest. In the following example the first file (cssSiteAll.css, located in a directory named css) has all the css in it, and it works in non-IE browsers like FireFox. Then, the next file (cssSiteIEAll.css) holds only css that is needed to correct problems that occur when viewing your site in any IE browser. It doesn't copy the entire cssSiteAll.css file - it only holds the changes needed for IE to look good. Other, non-IE browsers will ignore this css. Next, if there is something that looks good in IE6 or less, but shows up bad in IE7, the third css file holds css for just those corrections.
<link href="css/cssSiteAll.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="css/cssSiteIEAll.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 7]>
<link href="css/cssSiteIE7.css" rel="stylesheet" type="text/css" />
<![endif]-->
Somewhat confusing, but try it out - it works.
Dan