Conditional comments are supported only in IE9 and below and not supported in IE10, IE11 or Edge. If you really need to detect browser you should use some javascript library like this (add this code in the end of file before closing </body>
tag):
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-browser/0.0.8/jquery.browser.min.js">
<script>$('html').addClass($.browser.name);</script>
<style>.msie .iemargin {margin-top:30px;}</style>
- Including jQuery. If you have it already you can skip.
- The library that detects browser.
- Adding class with browser name to
html
element on page.
- Using class
.msie
to apply styles only to Internet Explorer.
Fiddle: http://jsfiddle.net/av5tw588/1/