CSS 不会在IE上执行
CSS that will not be executed on IE
在中我找到了下一个@media
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
}
这个媒体里面的CSS只会在IE中执行。
你能提出相反的建议吗CSS?将在除 IE 之外的任何浏览器中执行(我对 IE 11 感兴趣)
你的想法是错误的 - 你应该只应用你想要的样式,然后在你的 ie only 媒体查询中重新设置它们
/* use this to style all browsers */
.no-ie-style {
font-weight: bold;
text-decoration: underline;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* use this to reset to defaults */
.no-ie-style {
font-weight: normal;
text-decoration: none;
}
}
<div class="no-ie-style">hello</div>
在@media
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
}
这个媒体里面的CSS只会在IE中执行。
你能提出相反的建议吗CSS?将在除 IE 之外的任何浏览器中执行(我对 IE 11 感兴趣)
你的想法是错误的 - 你应该只应用你想要的样式,然后在你的 ie only 媒体查询中重新设置它们
/* use this to style all browsers */
.no-ie-style {
font-weight: bold;
text-decoration: underline;
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* use this to reset to defaults */
.no-ie-style {
font-weight: normal;
text-decoration: none;
}
}
<div class="no-ie-style">hello</div>