HTML and CSS Reference
In-Depth Information
Test driving Tony's new fonts
Open the page with the new CSS in the browser and you
should see we've now got a nice set of sans-serif fonts.
Let's check out the changes…
Because f ont-famil y is an inh erited pro perty,
all elemen ts on the page are now using a
sans-serif font, eve n the list elements…
Q: So the font-family
property is really a set of
alternative fonts?
A: Yes. It's basically a priority
list of fonts. The first is the font
you'd like used, followed by a
good substitute, followed by
more substitutes, and so on. For
the last font, you should specify
the catch-all generic “sans-serif”
or “serif”, which should be in the
same family as all the fonts in
your list.
Q: Are “serif” and
“sans-serif” real fonts?
A: “serif” and “sans-serif” are
not the names of actual fonts.
However, your browser will
substitute a real font in place of
“serif” or “sans-serif” if the other
fonts before it in the font-family
declaration can't be found.
The font used in its place will
be whatever the browser has
defined as the default font in
that family.
Q: How do I know which to
use? Serif or sans-serif?
A: There are no rules.
However, on a computer display,
many people consider sans-serif
the best for body text. You'll find
plenty of designs that use serif
for body text, or mix serif fonts
with sans-serif fonts. So, it really
is up to you and what kind of
look you want your page to have.
Q: How do I specify a font
with multiple words in the
name, like Courier New?
A: Just put quotes around
the name in your font-family
declaration, like this:
font-family: "Courier
New", Courier;
Search WWH ::




Custom Search