使用媒体查询将CSS应用于除IE之外的所有浏览器 [英] Apply CSS to all browsers except IE using media query
本文介绍了使用媒体查询将CSS应用于除IE之外的所有浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我找到了一种使用以下方法将媒体查询应用于IE的方法:
I found a way to apply media queries to IE using:
@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
}
有没有一种方法可以将CSS应用于除IE之外的所有浏览器?像这样:
Is there a way do the same to apply CSS to all browsers but IE? Something like:
@media not( (-ms-high-contrast: none), (-ms-high-contrast: active) ) {
}
我想避免使用HTML标记.
I'd like to avoid using the HTML tags.
推荐答案
使用兼容.
Use a @supports
query for browsers that are not Internet Explorer. @supports
queries are compatible with all browsers except Internet Explorer.
@supports not (-ms-high-contrast: none) {
/* Non-IE styles here */
}
这篇关于使用媒体查询将CSS应用于除IE之外的所有浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文