Inserting Images on a Page

You can place all kinds of images on your Web page, from logos to photographs. Images placed as described here appear automatically when the visitor jumps to your page, as long as the browser is set up to view them.

To insert an image on a page:


Place the cursor where you want the image to appear.


Type <img src="/books/2/62/1/html/2/image.url" where image.url indicates the location of the image file on the server (see page 35).


Type a space and then the final />.

Figure 5.7. The URL for this image, since it contains only the file name and no path, indicates that the image is located in the same folder as this Web page.


  • Add a p or br tag before an image to start it on its own line.

  • Images must be uploaded to the server before visitors will be able to see them (see page 353).

    Figure 5.8. Images are aligned to the left side of the page, by default. You can change the alignment or wrap text around an image.

  • Don't expect your visitors to wait very long for your page to load and view. Test it (keeping in mind you may have a faster connection than your visitors). If you can't wait, they won't either. One alternative is to create miniatures (see page 95) of large images and let visitors choose to view the larger images through a link (see page 115).

  • There is a deprecated border attribute (border="n", where n is the width in pixels) that adds or eliminates a border around images, especially the automatic border that appears around images used in links (see page 114). Better yet, you can use styles to control this and all other aspects of images (see page 184).

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 © 2008-2017.
If you may any questions please contact us: