When Images Don t Appear

When Images Don't Appear

Little red x's, broken icons, alternate text, or nothing at all. Regardless, it's a drag if what you really wanted was a picture of an iguana.

When images don't appear:

  • First, check that the file name of the image on the server matches the name you've referenced in the img tag exactly, including upper- and lowercase letters, and the extension (Figure 22.21).

    Figure 22.21. The file name for the image is iguana.jpg but here it is incorrectly referenced as Iguana.jpg, with a capital I.

  • Don't use spaces in file names. While they may work locally (on your personal computer), servers can't handle them. For more information, consult File Names on page 34.

    Figure 22.22. On your computer, the page looks fine because your computer isn't picky about upper- and lowercase letters.

  • Next, make sure the image's location is specified correctly in the URL in the img tag. One easy test is to put an image in the same directory as the (X)HTML page. That means you'll just need the proper file name and extension in the img tag, but no path information. If the image shows up, you can be pretty sure that the problem was in the path. For more information on URLs, see pages 3537.

  • If the image shows up when you view your page on your computer but not when you upload the page to the server, make sure you've uploaded the image to the server (see page 353), and that its location on the server is reflected in the img tag's URL.

  • Have you saved the image as GIF or JPG? I've seen Windows users create images in BMP format (which Internet Explorer for Windows has no trouble with) and then not understand when a non-Microsoft browser (on Windows or Mac) displays a broken image icon instead of the graphic. For more information, see Chapter 5, Images.

Figure 22.23. When the page is published to the server, which is case sensitive, the image cannot be found and the alt text is shown instead.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon

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