How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?

前端 未结 25 3091
谎友^
谎友^ 2020-11-22 06:19

How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?

I tried this, but

25条回答
  •  执笔经年
    2020-11-22 06:39

    Both solutions posted here (with slight modifications) work:

    
    

    or

    
    

    You include either of the above lines inside of head tag of your html page before your css link. And then in css file you specify your styles having "ie10" class as a parent:

    .ie10 .myclass1 { }
    

    And voilà! - other browsers stay intact. And you don't need jQuery. You can see the example how I implemented it here: http://kardash.net.

提交回复
热议问题