为什么用户代理样式表会覆盖我的样式?

问题描述:

我想要一个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.