Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does user agent stylesheet override my styles? [closed]

Tags:

css

font-size

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 

Under computed styles in Firefox I get:

font-size: 16px    TABLE[0].style → 11px    element    .v11gray → 11px  style.css:19 

The last three lines are struck out. Why is my css rule being overridden? Are there steps I can take to find out?

like image 405
Joe Avatar asked Jul 05 '12 16:07

Joe


People also ask

Can you override user agent stylesheet?

You can override user agent stylesheet declarations with your author styles. And indeed, you do that every day when you write your CSS. Author styles override user styles, which override user agent styles.

How do I get rid of user agent stylesheet in Safari?

Question: Q: Mac - safari -User Agent StylesheetClear the history and browser cache, after you have set the Safari Preferences : Advanced : StyleSheet to None. You will have to quit and relaunch Safari afterwards to be rid of the “User agent Stylesheet” properties.

What is the user agent stylesheet?

User-agent, or browsers, have basic style sheets that give default styles to any document. These style sheets are named user-agent stylesheets. Most browsers use actual stylesheets for this purpose, while others simulate them in code. The end result is the same.


1 Answers

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.

like image 93
kburke Avatar answered Oct 06 '22 00:10

kburke