Mike Buettner wrote:
> Thanks for the help Francky.
>    " * You have put the IE-only-styles in the body of the document; they
>       should go to the head part. Notice: the html-validator doesn't
>       notice this, because these styles are placed (correctly) in IE
>       conditional comments, which are just normal comments / unseen by
>       other browsers and the validator as well (REM: what is inside a CC
>       is not validated!)."
>
> I'm a little behind the learning curve on -only- styles. I take it you 
> are talking about this:
>
> <!--[if lte IE 6]><style>#p7PMnav a{height:1em;}#p7PMnav 
> li{height:1em;}#p7PMnav ul 
> li{float:left;clear:both;width:100%}</style><![endif]-->
> <!--[if IE 6]><style>#p7PMnav ul li{clear:none;}</style><![endif]-->
> <!--[if IE 7]><style>#p7PMnav a{zoom:100%;}#p7PMnav ul 
> li{float:left;clear:both;width:100%;}</style><![endif]-->
>
> Can this go anywhere in the head?
> Mike
Yes Mike,
on condition these lines are following the normal style declarations / 
links to stylesheet(s). Otherwise the normal styles later on are 
overruling the IE-specialties, and there is no correction for IE.
In fact it are normal style declarations in the head (only in very 
compact notation), but because of the wrapping comment construction the 
styles are only readable for IE.
It is easier to recognize in the more extended notation:

     <!--[if lte IE 6]> 
          <style>
               #p7PMnav a {height:1em;}
               #p7PMnav li {height:1em;}
               #p7PMnav ul li {
                    float:left;
                    clear:both;
                    width:100%;
                    }
          </style>
     <![endif]-->

... and so on.
To be complete, you can add the type-property:

     <style type="text/css">

An alternative way, if there is a bunch of styles for (versions of) IE, 
is to direct IE (or one or more IE-versions) to special (additive) 
IE-stylesheet. This can be done by means of the same CC (conditional 
comment) method, again following on the link to the normal stylesheet(s).

     <link rel="stylesheet" type="text/css" 
           href="css/general.css">

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

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

.. and so on.
In the same way, you can link to an IE-only script in the head; or give 
IE-only messages in the body, as was done in the early years of the CC's:

     <body>
     <!--[if IE]>
          <p>Dear visitor, you're surfing with Internet 
          Explorer. Consider to 
          <a href="http://browsehappy.com/";>Browse 
          Happy</a>!</p>
     <![endif]-->

More about serving CC's to IE can be found of MS's MSDN:

    * About Conditional Comments
      
<http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>

To view in IE ... [1]

Greetings,
francky

[1]
To see why this IE page isn't coming through in FF or Opera: check the 
html-validator. :-)




______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to