|
Images
may be added to your web page as easily as links.
The <img> tag is used to define an image.
This tag does not have a closing tag. However,
there are parameters defined for this tag. The
following example adds an image to a Web Page:
| <img
src="http://www.2kweb.net/image-file.gif"
alt="Text that displays if image doesn't
load"> |
The alt parameter is used to define a piece of
text to be displayed for when the browser doesn't
successfully load the image. This can happen if
there is a problem with the internet traffic,
or if one of the connections between the server
and the client (browser) gets broken, or if the
web surfer clicked on the stop button to stop
loading the image.
In
the previous example, I used the complete URL
to the image file, however relative URL's can
be used if the image file is stored in the same
directory on the same server as the HTML document
that executed the call to retrieve the Image file.
You
can also specify the justification (i.e. Alignment)
parameter as in the following example which will
center the image (Remember to also use the <center>
and </center> tags for those browsers that
don't support the justification parameter in the
<img> tag.
|
<img
src="http://www.2kweb.net/image-file.gif"
alt="Text that displays if image
doesn't load" ALIGN="center"> |
You can also right justify the image by simply
using the value of "right" for the ALIGN
parameter as in the following example:
| <img
src="http://www.2kweb.net/image-file.gif"
alt="Text that displays if image doesn't
load" ALIGN="right"> |
Links to other Pages
Targets
and Anchors
Adding
an Image
Client
Side Image Maps
Embedding
Midi/Wave Files
|