7

I'm trying to link to IE10 with an external style sheet but its not working properly. whats happening is IE10 is using the same style sheet as the other browsers. i have attached different stylesheets for IE 9 and 8 and those are fine. i even tried to have a style sheet for the other browsers but IE 10 seems to think its one of the other browsers.

<!--[if lt IE 10]>
<link rel="stylesheet" type="text/css" href="ie10.css" />
<![endif]-->
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
user2022071
  • 71
  • 1
  • 1
  • 3

4 Answers4

12

[if gt IE 9] for 'greather than' 9

explained here : http://msdn.microsoft.com/en-us/library/ms537512%28v=vs.85%29.aspx

BUT you should read carefully over the net ( http://www.sitepoint.com/microsoft-drop-ie10-conditional-comments/) ... ie10 dropped conditional comments.

Same topic here How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?

no more support for conditional comments

And to answer to : link to IE10 -->

Perhaps you can try some jQuery like this (nota: This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin.):

if ($.browser.msie && $.browser.version == 10) {
  $("html").addClass("ie10");
}

Or you can try the @media -ms-high-contrast Hack like this:

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {  
   /* IE10-specific styles go here */  
}

or you can try the @media Zero Hack

@media screen and (min-width:0\0) {  
    /* IE9 and IE10 rule sets go here */  
}
Community
  • 1
  • 1
Milche Patern
  • 19,632
  • 6
  • 35
  • 52
  • Thanks a lot guys...THE WEBSITE im working on is www.thesda.co.za. Maybe you can have a look, the fade in sliders in the sidebar is not picking up in IE10 and the multiple backgrounds not working properly in IE8 ,so I have issues. Thanks a lot for your help guys...REALY APPRECIATE IT. – user2022071 Jan 30 '13 at 14:00
  • 1
    FYI `$.browser` has been deprecated from jQuery since version 1.3 and removed in jQuery 1.9. Source: http://api.jquery.com/jquery.browser/ – tanguy_k Feb 24 '14 at 20:23
1

You probably want lte (less than or equal) or exact match instead of lt (less than).

Lie Ryan
  • 62,238
  • 13
  • 100
  • 144
  • Lie you answered this awhile back and it sounds the most logical to me. Have you tested this method before? I have a mac so I can't test it out. `` – Bryan Willis Dec 17 '15 at 08:58
0

Just finishing up on an html email (responsive). And from what I've been reading so far the solution to IE 10 isn't having an external, but using:

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 

}

as part of the main css.

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Ed Beltran
  • 61
  • 1
  • 3
-5

If you're adding this to a wp theme you'll have to link it properly. Ex:

<!--[if lt IE 10]><link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/ie10.css" /><![endif]-->
  • -1 because what is a wp theme? btw the OP didnt ask for wordpress? Also downvoted because it sums it to -3. keep SO clean. – angabriel Jan 30 '14 at 13:13