tags:

views:

32

answers:

3

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
Damn you beat me by like 5 seconds ;)
codemonkeh
A: 

Use !important css property.

http://webdesign.about.com/od/css/f/blcssfaqimportn.htm

Like:

*{
YOUR_FONT_STYLE
}
Shubham
But why use !important? it's a hack, and setting the font on the body will cascade down.
Marko
I thought OP needed to apply it to **everything**.
Shubham
!important should only be used in scenarios where the order of your CSS definitions is crap, and you need rule x to override rule y.
Marko
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