HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 10. FONT FAMILIES 106


Required Answer:cursive


Toreallycustomize your webpages, you can create your own cursive font
based on your own personal handwriting. Okay, it is a bit more work than
most people would attempt, but wouldn’t it be cool?


Common examples of cursive include: Apple Chancery, Zapf Chancery,
Comic Sans (even though it has the word Sans in it). Also, any font with
the word cursive or script or manuscript in its name is probably a cursive
font.


10.3.5 Fantasy


Fantasyfonts make up a “none of the above” category. They may be fun
in headings but are generally not suitable for body text. Thefantasyfont
tends to be highly decorative. It might be good for monograms or fancy
initial capital letters, like with the:first-letterpseudo-class.


http://cssfontstack.com/has a list of fonts.


10.4 The Font Stack


Thefont-family: CSS attribute lets you specify the font in which your
text will be presented. There are many thousands of fonts that have been
created.


The bad news is that (in 2012) only a small fraction of those thousands of
fonts that exist are installed on any one personal computer. If the designer
(you) wants the user to see the page rendered using a particular font, and
the user does not have that font installed, then the browser will need to
choose another font and it may not be what the designer wanted.


The current solution to this problem is the “CSS font stack.” For each font
specification, the webpage designer gives a list (or stack) of fonts that would
be acceptable. The browser will use the first font if it is available to the
user. If that font is not available, it checks for the next font (thefallback
font), and the next. Hopefully at least one font is available.


Specify the best font first, and then a list of fallback choices, and finally a
generic font last.


Font Family Examples:Here are a few examples.

Free download pdf