1

I am trying to put conditional statements for internet explorer in my EJS template. It remains as comment in my ejs file. I tried below 2 approaches.

<!-- [if gte IE 8 ]>
<style>
    .cs-fixed-header-table {
        height: 500px;
    }
</style> 
<![endif] -->

AND

<!--[if gte IE 8 ]>
    <link rel="stylesheet" href="IEstyle.css">
<![endif]-->

Anyone of these does not work. What can be done to achieve this ?

Thanks in advance.

Alpesh Prajapati
  • 1,593
  • 2
  • 18
  • 38

1 Answers1

1

Conditional comments are not supported by newer versions (IE10+) of Internet Explorer, see here.

So if you really want to handle IE10 or IE11 differently then I'd recommend you do it either through different responses handled by the server or using javascript on the client.

Emil Ingerslev
  • 4,645
  • 2
  • 24
  • 18
  • hey thanks man....it gave a way to go on. I tried media query mentioned at http://stackoverflow.com/questions/19446584/why-doesnt-internet-explorer-11-honour-conditional-comments-even-when-emulating and it worked. Do Check the answer given by cmartin. – Alpesh Prajapati Jul 17 '15 at 12:12
  • Oh yeah of cause media queries could also be used :) And glad I could help. – Emil Ingerslev Jul 17 '15 at 12:17