CSS Hack :: Detecting IE11 using Js and CSS


JS

// Can also be used with $(document).ready()
jQuery(window).load(function() {
if(navigator.userAgent.match(/Trident.*rv:11\./)) {
jQuery('body').addClass('ie11');
}

});

CSS
And then in the css file things prefixed with

body.ie11 #some-other-div

 

Advertisements

IE10 CSS Hack



@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {

/* Your IE10 style here */

.example { color:red;}

}