The <img> Tag and Its Attributes 161
ObjectsImages &
The <img> Tag and Its Attributes
Web Design in a Nutshell, eMatter Edition
The universally supported values for vertical alignment aretop,middle, and
bottom. Netscape Navigator introduced another (somewhat more subtle) set,
which was then picked up for support in Internet Explorer 4.0. These are
absbottom,absmiddle,texttop, andbaseline (the same asbottom).
Figure 9-11 demonstrates the intended effects of each of these alignment values.
The reality is slightly different. The absbottomvalue, for instance, seems to
render the same asbottom, even in Navigator.
Horizontal Alignment
Thealignattribute can be used to align a graphic horizontally on a page using
the valuesleft orright.
When a graphic is aligned left, it is placed along the left margin of the page and
text is allowed to flow around it. Likewise, a right-aligned graphic is placed against
the right margin, with text wrapping around it. Figure 9-12 shows how images are
displayed when set to align to the left or right.
Figure 9-11: Vertical alignment values
Figure 9-12: Text wraps around images when they are aligned to the left or right
top T
middle y
bottom y
texttop T
absmiddle y
absbottom y
<IMG SRC="leaf.gif" ALIGN=right>An Oak and a Reed
were arguing about their strength...
<IMG SRC="leaf.gif" ALIGN=left>An Oak and a Reed
were arguing about their strength...