Why does IE9 on emulation mode render conditional comments?

30 Views Asked by At

I am testing css with conditional comments on internet explorer 9 using emulation mode, however it seems to render the css on screen as text. why is this happening?

enter image description here

<!--[if IE]>
  .path2 {
    font-weight:300;
  } 
<![endif]-->
1

There are 1 best solutions below

1
lonesomeday On BEST ANSWER

Because conditional comments are rendered as HTML, not CSS. So if you want styles, you have to add a style tag:

<!--[if IE]>
  <style type="text/css">
    .path2 {
      font-weight:300;
    } 
  </style>
<![endif]-->