为什么用户代理样式表会覆盖我的样式? [英] Why does user agent stylesheet override my styles?
问题描述
我想要一个11的字体大小,但Chrome和Firefox正在给我16.当我检查Chrome中的元素时,我看到并查看计算属性我看到:
I want a font-size of a 11, but Chrome and Firefox are giving me 16. When I examine the element in Chrome I see and look at the computed property I see:
font-size: 16px;
table - medium user agent stylesheet
Style Attribute - 11px
table - medium user agent stylesheet
.v11gray - 11px style.css
在Firefox中的计算样式下,我得到:
Under computed styles in Firefox I get:
font-size: 16px
TABLE[0].style → 11px element
.v11gray → 11px style.css:19
最后三行被剔除。为什么我的CSS规则被覆盖?
The last three lines are struck out. Why is my css rule being overridden? Are there steps I can take to find out?
推荐答案
这是一个外部的没有你的代码,但解决方案时,我有完全一样的问题。我的DOCTYPE语句已被错误的按键击中,如这个问题。您可能希望通过视觉检查和/或验证。
This is an outside shot without your code, but the solution when I had the exact same problem. My DOCTYPE statement had gotten fouled up by an errant keystroke, as described in this question. You might want to inspect it visually and/or validate.
这篇关于为什么用户代理样式表会覆盖我的样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!