Sams Teach Yourself HTML 4 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Put Your HTML Page Online Today
- I. Your First Web Page
- Hour 1. Understanding HTML and XML
- Hour 2. Create a Web Page Right Now
- Hour 3. Linking to Other Web Pages
- Hour 4. Publishing Your HTML Pages
- II. Web Page Text
- Hour 5. Text Alignment and Lists
- Hour 6. Text Formatting and Font Control
- Hour 7. Email Links and Links Within a Page
- Hour 8. Creating HTML Forms
- III. Web Page Graphics
- Hour 9. Creating Your Own Web Page Graphics
- Hour 10. Putting Graphics on a Web Page
- Hour 11. Custom Backgrounds and Colors
- Hour 12. Creating Animated Graphics
- IV. Web Page Design
- Hour 13. Page Design and Layout
- Hour 14. Graphical Links and Imagemaps
- Hour 15. Advanced Layout with Tables
- Hour 16. Using Style Sheets
- V. Dynamic Web Pages
- Hour 17. Embedding Multimedia in Web Pages
- Hour 18. Interactive Pages with Applets and ActiveX
- Hour 19. Web Page Scripting for Non-Programmers
- Hour 20. Setting Pages in Motion with Dynamic HTML
- VI. Building a Web Site
- Hour 21. Multipage Layout with Frames
- Hour 22. Organizing and Managing a Web Site
- Hour 23. Helping People Find Your Web Pages
- Hour 24. Planning for the Future of HTML
- VII. Appendixes
- A. Readers' Most Frequently Asked Questions
- B. HTML Learning Resources on the Internet
- C. Complete HTML 4 Quick Reference
- D. HTML Character Entities
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:
- To line up the top of an image with the top of the tallest image or letter on the same line, use <img align="top" />.
- To line up the bottom of an image with the bottom of the text, use <img align="bottom" />.
- To line up the bottom of an image with the bottom of the lowest image or letter on the same line, use <img align="absbottom" />. (If there are some larger images on the same line, align="absbottom" might place an image lower than align="bottom".)
- To line up the middle of an image with the baseline of the text, use <img align="middle" />.
- To line up the middle of an image with the overall vertical center of everything on the line, use <img align="absmiddle" />. This might be higher or lower than align="middle", depending on the size and alignment of other images on the same line.
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.
Figure 10.6 You can control the vertical alignment of images with the align attribute.
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.
Summary | Next Section

Account Sign In
View your cart