简体   繁体   English

IE8!重要错误?

[英]IE8 !important bug?

I might be missing something else, but im working on a site i didnt buid which has loads of very messy css and multiple !important overrides. 我可能会错过其他东西,但是我正在一个没有工作的站点上工作,该站点具有非常混乱的CSS和多个!important覆盖。 One layout issue is fine in all browsers except some versions of IE. 除某些版本的IE之外,所有浏览器都可以解决一个布局问题。

When I look at the css with developer tools i can see the margin of 1em is being overiden by a margin of 0.5em, however the margin it too big on the page. 当我使用开发人员工具查看CSS时,我看到1em的边距被0.5em的边距所覆盖,但是在页面上的边距太大。 Even though the margin of 1em looks like its being overridden (in developer tools) when I disable the style it works fine, in other words the margin becomes less. 即使当我禁用样式时1em的边距看起来像被覆盖(在开发人员工具中),它的工作原理也很好,换句话说,边距变得更少了。

So, are their any bugs where IE doesn't respect the normal hierarchy of overrides if multiple !importants are used? 因此,如果使用了多个!important,它们是否存在IE不尊重替代的普通层次结构的错误? Or could this be a bug in the developer tools instead? 还是这可能是开发人员工具中的错误?

By overrides I mean something like the example below, where the 2nd css should override the first: 通过覆盖,我的意思是类似下面的示例,其中第二个CSS应该覆盖第一个:

.div2 {
    margin: 1em !important;
}

body .div2 {
    margin: 0.5em !important;
}

Thanks 谢谢

内联样式覆盖外部样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM