IE 7 not support <![if IE]> ?

Soldato
Joined
2 May 2004
Posts
19,950
Hi,

I have this in the head of my document:

Code:
<![if !IE]>
<link href="stylesheet_mo.css" rel="stylesheet" type="text/css"/>
<![endif]>

<![if IE]>
<link href="stylesheet_ie.css" rel="stylesheet" type="text/css"/>
<![endif]>

Within stylesheet_mo.css is the fix to make fieldsets look good.

Within stylesheet_ie.css is just some basic CSS.

All this put together makes fieldsets look the same in both IE and Mozilla...

Anyway, since IE7 it doesn't seem to be working anymore, the fieldsets aren't showing up at all, yet they still work fine in Mozilla.

Any ideas if IE doesn't support the <[IF IE]> thing anymore please?

Thanks,
Craig.
 
Conditional comments are just like programming conditionals. So you can check whether the version number is greater than, equal to and less than another number.

Code:
<!--[if IE 7]>
Just for IE7
<![endif]-->

<!--[if gte IE 7]>
For IE7 and above (gte = greater than or equal to)
<![endif]-->

<!--[if lt IE 7]>
For all versions below IE7 (lt = less than)
<![endif]-->

You might also be having issues as comments must always start <!-- and end with -->.

http://www.quirksmode.org/css/condcom.html
 
Actually, both <![if and <!--[if are valid. The first is a "Downlevel-Revealed", the latter a "Downlevel-Hidden". Hidden/shown in a similar fashion to using <!-- > inside script tags. Browsers that do not support the tags will always parse the contents for revealed, but for hidden it will treat them as comments.
 
Last edited:
Hmmm, it still doesn't wanna work :(

stylesheet_mo.css:

Code:
body {
  font-family: Verdana;
  font-size: 12px;
  }

fieldset {
  -moz-border-radius: 6px;
  border: 1px solid #CFCFC5; 
  }

legend {
  color: #0046d5;
  margin: 0;
  }

stylesheet_ie.css:

Code:
body {
  font-family: Verdana;
  font-size: 12px;
  }

Head of page:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<![if !IE]>
<link href="stylesheet_mo.css" rel="stylesheet" type="text/css"/>
<![endif]>

<![if IE]>
<link href="stylesheet_ie.css" rel="stylesheet" type="text/css"/>
<![endif]>
<title>title</title>
</head>

Any ideas why the iFrames are not showing up anymore please? It doesn't seem to be an issue with the IF statements.

Thanks,
Craig.
 
Found the problem:

UzJSUBGo_search.png


It's my Windows XP style. :rolleyes:
 
Back
Top Bottom