Apply CSS to all browsers except IE using media qu

2020-06-08 07:43发布

I found a way to apply media queries to IE using:

@media (-ms-high-contrast: none), (-ms-high-contrast: active) {

}

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) ) {

}

I'd like to avoid using the HTML tags.

1条回答
淡お忘
2楼-- · 2020-06-08 07:59

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 */
}

Example on Codepen

查看更多
登录 后发表回答