Basically, I need to adjust the font type everywhere it isn't specified. How can I do that? table, div, span, p, input, you name it. Is there a way I can do them all with 1 css rule that I can add?
+3
A:
Yes there is, use it on the body element and it will cascade down to all children unless you specify otherwise.
body {
font-family: Arial, Verdana, sans-serif;
}
#tahoma {
font-family: Tahoma, sans-serif;
}
You can then override it
<body>
<div id="default">
I will inherit the body font-family, in this case Arial because no other rule has been set!
</div>
<div id="tahoma">
<p>Me, <span>Me</span> and <strong>Me</strong> are using Tahoma because our parent #tahoma says so.</p>
</div>
</body>
Marko
2010-08-12 04:49:48
Damn you beat me by like 5 seconds ;)
codemonkeh
2010-08-12 04:51:33
A:
Use !important css property.
http://webdesign.about.com/od/css/f/blcssfaqimportn.htm
Like:
*{
YOUR_FONT_STYLE
}
Shubham
2010-08-12 04:50:37
A:
This is why it's called Cascading Style Sheets. Styles set at any level will "cascade" down. So if you set this styling on the body
element, every other element in the body
will take on the same styles.
body {
font: ...;
}
jtbandes
2010-08-12 04:51:13