javascript - How to add CSS Hack specifically for IE10? -
javascript - How to add CSS Hack specifically for IE10? -
i trying add together css ie 10.
actually css working fine in chrome , firefox. creating problem in ie 10.
i tried code , made ie10.css not working.
<script> if (/*@cc_on!@*/false) { var headhtml = document.getelementsbytagname('head')[0].innerhtml; headhtml += '<link type="text/css" rel="stylesheet" href="css/ie10.css">'; document.getelementsbytagname('head')[0].innerhtml = headhtml; } </script>
it not working. kindly help.
you can track latest versions of ie (mostly ie 10 , ie 11) using
1. css media query hack:
/* #ie10,11 reddish in msie 10, both in high contrast (display setting) , default mode */ @media screen , (-ms-high-contrast: active), (-ms-high-contrast: none) { //-- set ie specific css class here }
or
@media screen , (min-width:0\0) { /* ie9 , ie10 rule sets go here */ }
read this
working example
2. browser detection:
if ($.browser.msie && $.browser.version == 10) { $("html").addclass("ie10"); }
3. using script (not tested):
<script> /*@cc_on @if (@_jscript_version == 10) document.write('<link type= "text/css" rel="stylesheet" href="your-ie10-styles.css" />'); @end @*/ </script >
note : know document.write
considered bad practice.
conditionnal comments (ie10 dropped conditionnal comments):
if want load external css file ie, can utilize conditionnal comments. mentioned in question wants ie 10 , ie10 dropped conditionnal comments.
microsoft-drop-ie10-conditional-comments.
javascript jquery css css3 internet-explorer-10
Comments
Post a Comment