문제

I am new user for IE11. I want to integrate one IE11 specific css in my extjs application. I have searched a lot. If anybody is having any idea , please let me know..I am having heavy deadline on this. Thanks in advance.

도움이 되었습니까?

해결책

    applyIEFont = function() {
        var iev=0;
        var ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
        var trident = !!navigator.userAgent.match(/Trident\/7.0/);
        var rv=navigator.userAgent.indexOf("rv:11.0");

        if (ieold) iev=new Number(RegExp.$1);
        if (navigator.appVersion.indexOf("MSIE 10") != -1) iev=10;
        if (trident&&rv!=-1) iev=11;

        if(iev == 11 || iev == 10) {
            $('.menuCaption').css({ font: 'normal 34px arial, "SegoeUi"'});
        }
    };

    setInterval(applyIEFont, 300);
    $(document).ready(applyIEFont);

look this code. Conditional comments doesn't work in ie11, so you have to do it with js

다른 팁

Your best bet would be to detect IE 11 and apply CSS classes accordingly. Something like this (using jQuery):

$(window).load(function(){
  if(navigator.userAgent.match(/Trident.*rv:11\./)) {
    $('body').addClass('ie11');
  }
});

You can apply that class to any element that you know you have IE 11 exceptions then just use the class in your CSS like so:

body.ie11 { }

Here is a two steps solution here is a hack to IE10 and 11

    @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {  
   /* IE10+ specific styles go here */  
}

because IE10 and IE11 Supports -ms-high-cotrast you can take the advantage of this to target this two browsers

and if you want to exclude the IE10 from this you must create a IE10 specific code as follow it's using the user agent trick you must add this Javascript

 var doc = document.documentElement;
doc.setAttribute('data-useragent', navigator.userAgent);

and this HTML tag

<html data-useragent="Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)">

and now you can write your CSS code like this

html[data-useragent*='MSIE 10.0'] h1 {
  color: blue;
}

for more information please refer to this websites,number one:wil tutorail

number two:Chris Tutorial

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top