gpt4 book ai didi

css - IE 10+ 特定的 css 规则在 IE 中不优先

转载 作者:太空宇宙 更新时间:2023-11-04 07:09:38 25 4
gpt4 key购买 nike

根据这个答案,以下内容可用于针对 IE10 和 IE11:

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* css specific to IE10 and IE11
}

所以我是我的css文件,我有一个规则,比如下面的。

.bigbox {
display: flex;
}

因为我不想让 IE 显示这个框,所以我在初始声明下面有以下内容:

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.bigbox {
display: default;
}

}

当我使用 IE 中的开发人员工具检查 div 时,我可以看到 IE11 可以看到这两个规则,但它会优先考虑非 IE 特定的规则,因此会 flex 该框。为什么要这样做?有办法避免这种情况吗?

我什至将 IE 声明设置为 !important,但它也没有任何作用。

谢谢!

最佳答案

没有“显示:默认”这样的东西。

尝试“显示:初始;”或更合适的东西(内联、 block )。

//编辑:请参阅此处以供引用: https://developer.mozilla.org/en-US/docs/Web/CSS/display

关于css - IE 10+ 特定的 css 规则在 IE 中不优先,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51285231/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com