Images

 

Images are placed in web documents using the IMG tag. This tag has no closing tag. The basic form of the image tag is <IMG>, but just like <A>, <IMG> by itself will do nothing. You need to let the browser know where to find the image that you want to appear in the document.

Visually speaking, images are part of your web page, survey or form - but in reality, the image or graphic referred to is a separate file. The file is stored on a web server, and can be located virtually anywhere (connected to the Internet).

In order to make the IMG tag work, you need to use an SRC attribute. SRC stands for "source," as in, "the source of the image file." The value of SRC is the URL of the graphic you want to have displayed on your Web page. Thus, a typical image tag will take the form:

<IMG SRC="URL of image">

 

The URL of the image is just like the URLs used in the anchor tag, except in this case the location used is that of the image file. A file named "logo.gif" located in the directory "images" on the server "www.my-company.com" would have the URL

http://www.my-company.com/images/logo.gif

 

In relation to HTML text, the browser puts a graphic wherever an image tag occurs in the document. For example, if you put an image tag between two sentences, the browser would show the first sentence, then the graphic, and then the second sentence right after the graphic.
Placing images within links is also possible. To do so, merely place the IMG tag within the anchor container. For example:

<A HREF="http://www.my-site.org/"><IMG SRC="images/our-logo.jpg"></A>

 

< Back to Code Fragments and Scripts

 

 


 
 
 
 
 
 

Copyright © 1999-2004 Hostedware Corporation.
All Rights Reserved.