Tuesday, September 14, 2010

Defining fonts In Css

The font-family property enables you to specify a list of font face values, starting with
your preferred first choice, continuing with alternates (in case your choice isn’t installed
on the user’s machine), and terminating in a generic font family, which causes the browser
to substitute a similar font (think of it as a last resort).
selector {
font-family: preferred, alterate 1, alterate 2, generic;
}
The most common generic font family names are serif and sans-serif, although when
you’re using monospace fonts (such as Courier New), you should end your list with
monospace.
Multiple-word font family names must be quoted (such as "Trebuchet MS" and "Times
New Roman"). You can use single or double quotes—just be consistent. Single-word font
family names should never be quoted. Examples of font-family in use are as follows:
h1 {
font-family: Arial, Helvetica, sans-serif;
}
p {
font-family: Georgia, "Times New Roman", Times, serif;
}
pre {
font-family: Courier, "Courier New", Monaco, monospace;
}

**pre is the element for preformatted text, used to display monospace text in an identical
fashion to how it’s formatted in the original HTML document. It’s commonly used
for online FAQs, film scripts, and the like.

No comments:

Post a Comment