• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1: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?
A1: 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!
Q2:How long a message can I put after alt= in an <img /> tag?
A2: 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.
Q3: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?
A3: 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).
Q4:How do I control both the horizontal and vertical alignment of an image at once?
A4: 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.

Q5: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.
A5: 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….)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint