<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 />
相信看了本文案例你已經掌握了方法,更多精彩請關注Gxl網其它相關文章!
相關閱讀:
axios怎樣基于Promise的HTTP請求客戶端
VUE如何使用anmate.css
好用的404組件
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com