HTML and CSS Reference
In-Depth Information
Test drive your new CSS
As usual, go ahead and make these changes in the “lounge.css”
stylesheet, save, and reload the “lounge.html” page. You shouldn't
expect any changes, because the style is the same. It's just coming
from a different rule. But you should feel better about your CSS,
because now you can add new elements to your pages and they'll
automatically inherit the sans-serif font.
Surprise, su rprise. This d oesn't look an y
different at all, but th at is exactly w hat we
were expec ting, isn't it? All you've don e is move
the sans-s erif font up i nto the body rule and
let all the other elemen ts inherit tha t.
Okay, so now that the whole site is set
to sans-serif with the body selector, what
if I want one element to be a different
font? Do I have to take the font-family
out of the body and add rules for every
element separately again?
Search WWH ::

Custom Search