Internet Explorer Logo

IE 10 Drops Conditional Comments

OK, Everyone. Do not FREAK OUT yet. Yes, IE 10 Drops Conditional Comments. What is up Microsoft? What does this means to web designers and developers that have to support IE. It just means the old way of conditional commenting to target a specific IE version and then use a IE specific css stylesheet will not work. For example, the old way:

<!--- code for using different IE stylesheets --->
 
 <!--[if IE 8]>
       <link rel="stylesheet" type="text/css" href="http://library.utsouthwestern.edu/css/ie8.css" />
 < ![endif]-->
 <!--[if IE 9]>
    	<link rel="stylesheet" type="text/css" href="http://library.utsouthwestern.edu/css/ie.css" />
 < ![endif]-->

 

So here is the new way that I found that worked great for me.

In my main stylesheet, I use a media query to set the IE specific css style as such:

/**** IE 10 sepcific styles ***/ 
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) 
{ 
    #footer { 
        width: 525px; 
    } 
}

 

You can still use the old way if you have to support older versions of IE(7, 8, 9). But no dice for IE 10. For more information regrading this new issue check out this great article at SitePoint by Craig Butler.

Blog, Web Design, Web Development,

Leave a Comment

Your email address will not be published.