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
Q&A
-
I found a nice image on a Web page on the Internet. Can I just use Save Image As to save a copy and then put the image on my Web pages?
It's easy to do that, but unfortunately it's also illegal in most countries. You should first get written permission from the original creator of the image. Most Web pages include the author's email address, which makes it a simple matter to ask for permission—a lot simpler than going to court!
-
How long a message can I put after alt= in an <img /> tag?
Theoretically, as long as you want. For practicality, you should keep the message short enough so that it will fit in less space than the image itself. For big images, 10 words may be fine. For small images, a single word is better.
-
I used the <img /> tag just like you said, but all I get is a little box with an X or some shapes in it when I view the page. What's wrong?
The broken image icon you're seeing can mean one of two things: Either the Web browser couldn't find the image file, or the image isn't saved in a format the browser can understand. To solve either one of these problems, open the image file by using Paint Shop Pro (or your favorite graphics software), select Save As, and be sure to save the file in either the GIF or JPEG format. Also make sure you save it in the same folder as the Web page that contains the <img /> tag referring to it and that the filename on the disk precisely matches the filename you put in the <img /> tag (including capitalization).
-
How do I control both the horizontal and vertical alignment of an image at once?
The short answer is that you can't. For example, if you type <img align="right" align="middle" src="myimage.gif">, the align="middle" will be ignored.
There are ways around this limitation, however. In Part IV, "Web Page Design," you will discover several techniques for positioning text and images exactly where you want them in both horizontal and vertical directions.
-
Why do the examples in this book put a slash at the end of every <img> tag? None of the Web pages I see on the Internet do that.
As discussed in Hour 2 (yes, I know that was a long time ago), the new XML and XTHML standards will require any tag that doesn't have a closing tag to include a slash at the end. Though it may be unlikely that anyone will ever write software that fails to accept the traditional <img> tag without the slash, I use <img /> just to be on the safe side. (Remember, people once thought it was unlikely that four-digit date codes would ever be necessary in the software they were writing….)
Workshop | Next Section

Account Sign In
View your cart