An element??™s font-style is set like this:
h2 {
font-style: italic;
}
The font-weight property is intended to make a font heavier or lighter, and despite the
various available values, only bold and normal are in general use. This is detailed in full in
the font-weight entry of Appendix D (CSS Reference).
WORKING WITH TYPE
83
3
.introParagraph {
font-weight: bold;
}
The font-variant property has two available values: normal (the default) and small-caps.
Small caps are often used to de-emphasize uppercase letters in abbreviations and
acronyms, and are similar in size to a typeface??™s lowercase characters. This property only
affects lowercase letters, and display of small caps varies across browsers and platforms??”
for example, older versions of Internet Explorer simply render such text entirely in normal
caps (i.e., in standard uppercase letters).
CSS shorthand for font properties
The CSS properties discussed so far can be written in shorthand, enabling you to cut down
on space and manage your CSS font settings with greater ease. Like some other shorthand
properties, some rules apply:
Some browsers are more forgiving than others regarding required and optional
values, but you should always specify the font-size and font-family values, in
that order.
Omitted values revert to default settings.
The font-style, font-weight, and font-variant values, if included, should be
placed at the start of the rule (in any order), prior to the font-size value.
Pages:
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158