Question

I've attached a media queries stylesheet to my dreamweaver website, working good in all browsers. Only in IE no styles show up. I don't need the IE site to be responsive but I need it to just show the plain styles. I've tried putting this bit of code in the head tag:

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

And made a stylesheet called styles-ie.css, but still no styles show up in IE. Is there a simple way to tell IE to use this stylesheet?

Any help is much appreciated,

Lisa

No correct solution

OTHER TIPS

Your syntax looks correct to me. How are you testing this? Could it be that you are using IE 10 or above? If so, note that IE 10 and above do not support conditional comments at all, meaning this stylesheet will never be used.

You can always resort to JQuery or Modernizr as an alternative for IE10. For example, you can do

var doc = document.documentElement;
doc.setAttribute('data-useragent', navigator.userAgent);

and in your regular spreadsheet, you can add

html[data-useragent*='MSIE 10.0'] h1 {
  color: blue;
}

which will only activate for IE 10. More information on that here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top