Prev | Current Page 104 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"


Setting the Font Family for the Entire Page
To set the font family for the entire page, set it for the body of the
document

Add CSS for specifying a font
family in this blank line
STYLIN??™ FONTS AND TEXT 75
Save your changes, ?¬‚ ip to the browser, and refresh the page. What
you see should look like Figure 3.7.
Because font-family is an inherited property, its value is passed to
all its descendants, which, since body is the top-level element, are all
the other elements in the markup. So with one line, you??™ve made it
so that everything displays in the desired font. Bathe for a moment
in that glow of CSS magic. OK, moving right along??¦
FIGURE 3.7 Because font attributes
are inherited, specifying the font for
the body tag renders the entire document
in the speci?¬? ed font.
All browsers, except Safari, add a
blue border by default to any image
that is enclosed in an a tag to indicate
that it is clickable. I prefer to
use a tooltip for this purpose and
remove the default border, as I will
illustrate later.
STYLIN??™ WITH CSS - CHAPTER 3 76
Sizing Fonts
You can use three types of values to size fonts. They are absolute
(for example, pixels or inches), relative (for example, percentages
or ems), and what I call the sweatshirt keywords (for example, xsmall,
small, large, and xx-large, among others).


Pages:
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116