QA


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 if you don't have permission to reuse the image; of course, this excludes images found on royalty-free clip art web sites. 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 permissiona lot simpler than going to court!

Q2:

How long can I make a message that I put after alt= in an <img /> tag?

A2:

Theoretically, as long as you want. For practicality, you should keep the message short enough that it will fit in less space than the image itself. For big images, 10 words may be fine, and I've even seen people include a small paragraph of text in some cases. For small images, a single word is better.

Q3:

I used the <img /> tag just as you said, but all I get is a little box with an ¥ 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 GIF or JPEG format. Also make sure that 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). And make sure that the image file is in the same folder as the web page, or the exact relative folder if you've elected to place and reference images from their own folder.

Q4:

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.

A4:

As discussed in Hour 2, "Create a Web Page Right Now" (yes, I know that was a long time ago), the XTHML standards require any empty tag (a tag that doesn't have a closing tag) to include a slash at the end. Although it may be unlikely that anyone will ever write software that fails to accept the traditional <img> tag without the slash, you should use <img /> so that your pages are ready for the future Web as it continues to unfold. (Remember, people once thought it was unlikely that four-digit year codes for dates would ever be necessary in the software they were writing.…)




SAMS Teach Yourself HTML and CSS in 24 Hours
Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition)
ISBN: 0672328410
EAN: 2147483647
Year: 2005
Pages: 345

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net