HTML and CSS Reference
In-Depth Information
Using font-style to Italicize Text
he
font-style
property controls whether text is rendered in italic. It accepts the following values:
italic
Italicize the text.
normal
Remove italic.
oblique
Use an oblique version of the font, if one exists. Otherwise, use italic.
Because very few web-safe fonts have oblique versions,
italic
and
normal
are the only values you need. The
main use for
normal
is to remove italic from text that you want to emphasize inside a larger block of text that's
already italicized.
Using font-weight to Make Text Bolder or Lighter
he
font-weight
property accepts the following values:
bold
Make the text bold.
bolder
Make the text bolder in relation to its parent.
lighter
Make the text lighter in relation to its parent.
normal
Render the text normally.
One of nine values increasing in steps of 100 from
100
to
900
(
400
equals
normal
, and
700
equals
bold
).
In practice, the only values you are likely to use are
bold
and
normal
. Setting
font-weight
to
normal
is useful
when you want to display as normal text an element, such as a
<th>
tag (table heading), that browsers normally
render in a bold font.
Using font-variant to Display Text in Small Caps
In CSS2.1, the
font-variant
property accepts the following values:
normal
Render text using the same letter case as in the underlying code.
small-caps
Render the text in small caps if supported by the font. Otherwise,
transform the text to uppercase.
Small caps display lowercase letters as uppercase, but in a smaller size and with slightly different
proportions, as shown in Figure
4-5
(the code is in
small caps.html
).
Figure 4-5.
The font-variant property converts the font to small caps