为什么 Chrome Developer Tool 中的 height 属性显示为灰色

n17*_*911 5 css google-chrome

当我使用 Chrome 开发者工具检查一个元素时,height 属性是灰色的。从这里

https://developers.google.com/web/tools/chrome-devtools/iterate/inspect-styles/#live-edit-a-do-node

这意味着我无法编辑它。

But my question is why I can't edit it? And how can I find out which style in style set this property? With other properties, I can expand it? but for this greyed out one? I can't expand it.

cat*_*h22 4

这通常是由用户代理样式表引起的。通常,您可以通过重新排序 CSS 或使用 CSS 规范化器(例如normalize.cssreset.css,尽管如果您不需要全部代码,这些可能会给您的代码添加不必要的膨胀)来覆盖它。

请务必注意样式表的调用顺序,因为 CSS 根据定义是级联的,并且最低的定义优先。

在强力情况下,只有当没有其他明确的解决方案时,您才可以使用!important声明。