Biomehanika
Biomehanika

Reputation: 1540

IE not loading specific Stylesheet

As you can see on this live demo, I have a website with two stylesheets, one for our beloved IE and another one for the normal browsers, set like this on its header:

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

Even though I have checked many times its spelling, it seems correct but if you open the link from IE (IE v11, in my case), normal Stylesheet is loaded instead IE one.

To check easily if the other CSS is loaded, in theory, when opening the link from any IE and executing the menu (bottom right button), it has blue background.

What is missing here?

IE stylesheet has the entire normal stylesheed PLUS the additional properties needed for it to work, maybe this is wrong and shoul only have the additional properties..?

Upvotes: 0

Views: 56

Answers (2)

Pablo Rincon
Pablo Rincon

Reputation: 1039

IE stopped support for conditional comments as of IE10. At this point a better solution is to target CSS based on features rather than vendors/browsers. Tools like modernizr can really help you with this.

Upvotes: 1

j08691
j08691

Reputation: 208032

Conditional comments are no longer supported

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers. This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.

See: http://msdn.microsoft.com/en-us/library/ie/hh801214(v=vs.85).aspx

Upvotes: 2

Related Questions