HTML and CSS Reference
In-Depth Information
To see the impact of these styles, you'll return to the demo page.
To use the demo to view the various font styles:
◗
1.
Return to the
demo_css.htm
page in your Web browser.
◗
2.
Select
bold
in the font-weight box.
◗
3.
Select
small-caps
in the font-variant box. Figure 3-34 shows the impact of apply-
ing the font-weight and font-variant styles.
Figure 3-34
Applying the font-weight and font-variant styles
line height
reduced
to 0.75em
and text displayed
in small capitals
◗
4.
You've completed your work with the CSS demo page. If you wish, continue to
explore different CSS font and text styles. When you're finished, close the demo
Web page.
Aligning Text Horizontally and Vertically
In earlier examples from this tutorial, you saw how the text-align style could be used to
align text horizontally. The specifi c style is
text-align:
alignment
;
where
alignment
is
left
,
right
,
center
, or
justify
(align the text with both the left
and the right margins). To vertically align the text, use the style
vertical-align:
alignment
;
where
alignment
is one of the keywords described in Figure 3-35.