我找到了一种将媒体查询应用于 IE 的方法:
@media (-ms-high-contrast: none), (-ms-high-contrast: active) {
}
有没有办法将 CSS 应用于除 IE 之外的所有浏览器?像这样的东西:
@media not( (-ms-high-contrast: none), (-ms-high-contrast: active) ) {
}
我想避免使用 HTML 标签。
最佳答案
使用 @supports
查询非 Internet Explorer 的浏览器。 @supports
查询是 compatible with all browsers except Internet Explorer .
@supports not (-ms-high-contrast: none) {
/* Non-IE styles here */
}
关于html - 使用媒体查询将 CSS 应用于除 IE 之外的所有浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48412244/