untitled

(John Hannent) #1
When you specify a percentage for vertical alignment, the baseline of a text
element or the bottom edge of an image is displaced relative to the parent
element’s baseline. As you can see in Figure 7-13, the bottom of the square
image is about 80 percent below the baseline of the text (the letters without
descenders, such as the “s” and “o”).

Horizontal Alignment ..................................................................................


Adjusting text horizontally with the text-alignproperty is similar to vertical
alignment, except the following descriptive values are used: left, center,
right, or justify, and the results apply to an entire paragraph rather than
to individual words.

The values are essentially the same alignment values that you’d find in any
word processor. The default is left(for Western languages anyway). The
text-alignproperty can only be used with block-level elements, such as
the paragraph <p>element, as illustrated in Figure 7-14.

Figure 7-13:
Use
percentages
to specify a
relative
position, as
shown here.

Figure 7-12:
The
lowercase
“o” works
fine for the
degree
symbol if
you reduce
it to about
70 percent
in the Times
Roman font.

Chapter 7: Styling It Your Way 141

Free download pdf