How to solve the IE11 CSS Hack

Source: Internet
Author: User
This time to everyone to bring how to solve IE11 css Hack, to solve the IE11 of the CSS Hack considerations, the following is the actual case, together to see.

<script>//for ie10if (/* @cc_on!@*/false) {document.documentelement.classname+= ' IE ' +document.documentmode;} For IE11 and non-IE browser,//Because the IE11 under Document.documentmode is 11, so the HTML tag will be added Ie11 style class; Instead of IE, document.documentmode is undefined, so the HTML tag adds ieundefined style classes. if (/* @cc_on!@*/true) {document.documentelement.classname+= ' IE ' +document.documentmode;} <script/>
<style>.ie10.testclass{color:red}.ie11.testclass{color:blue}.ieundefined.testclass{color:green}<style />

Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!

Related reading:

Axios How to Promise-based HTTP request client

Vue How to use Anmate.css

Useful 404 Components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.