Home >Web Front-end >CSS Tutorial >How to solve IE11 css Hack
This time I will bring you how to solve the css Hack of IE11, and what are the precautions to solve the css Hack of IE11. The following is a practical case, let’s take a look.
<script> // 针对IE10 if(/*@cc_on!@*/false){ document.documentElement.className+=' ie'+document.documentMode; } // 针对IE11及非IE浏览器, // 因为IE11下document.documentMode为11,所以html标签上会加ie11样式类; // 而非IE浏览器的document.documentMode为undefined,所以html标签上会加ieundefined样式类。 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 />
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website Other related articles!
Related reading:
How axios makes HTTP request client based on Promise
The above is the detailed content of How to solve IE11 css Hack. For more information, please follow other related articles on the PHP Chinese website!