Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Vertical Image Alignment

Sometimes, you may want to insert a small image right in the middle of a line of text; or you might like to put a single line of text next to an image as a caption. In either case, it would be handy to have some control over how the text and images line up vertically. Should the bottom of the image line up with the bottom of the letters, or should the text and images all be arranged so their middles line up? You can choose between these and several other options:

Three of these options are illustrated in Figures 10.4 and 10.5. The ZOLZOL's logo is aligned with the top of the photos on either side of it by using align="top"; the picture of the water planet uses align="middle" to line up the baseline of the words Sol III with the center of the Earth; and the little image of the moon is lined up in the exact center of the text around it using align="absmiddle".

Figures 10.6 and 10.7 show a few more examples of using horizontal and vertical alignment tags.

10fig06.gif

Figure 10.6 You can control the vertical alignment of images with the align attribute.

10fig07.jpg

Figure 10.7 The top, middle, and bottom of each line depends on the size of the text and images on that line. Notice that the words "Friendly Fen" Zol and "Honest Han" Zol are actually two small image files, not text.

Share ThisShare This

Informit Network