<img src="images/dog.gif">
You should always provide text to be displayed when the
graphic is not available, this is done with the ALT
attribute. (If the graphic is purely decorative, an empty ALT
tag can be used.)
<img alt="Running dog" src="images/dog.gif">
Web browsers download the text of a page first, and then
try to lay out the page before the graphics have even been
obtained. To help the browsers in this task use the HEIGHT
and WIDTH attributes. (A perl tool called
wwwis
can do this for you.)
<img height="34"
width="36"
alt="Running dog"
src="images/dog.gif">
Simple moving images can be done with animated GIFs.
Note: As cute as they are, moving images can be so distracting that people may be unable to read from the page. Animations that execute once and stop are more reader-friendly.
The TITLE tag will cause a tool tip to be displayed when the cursor is hovered over the image.
<img height="34"
width="36"
alt="Yin and Yang"
title="Ying & Yang"
src="images/yin_yang.gif">
vertical-align style
(Cascading Style
Sheets)
can be used to change this.
.
Yin and
|
Yin and Yang.
|
Yin and
|
Yin and Yang.
|
Yin and
|
Yin and Yang.
|
An image can be made a link by surrounding it with an anchor:
<a href="http://www.amazon.com">
<img style="border: 0"
src="amazonlogo.gif">
</a>
The style="border: 0" keeps the image from
being surrounded by a blue box.
Inline images will be in one of three formats, GIF, JPEG or PNG. The relative advantages of these are covered in the section on graphics.
slide 12
|
"Mastering a Web Site" online course Created and maintained by Lorna Schmid and David Boldt. http://water.usgs.gov/usgs/training/webmaster/html_images.html Last modified: Tue Oct 14 17:49:54 EDT 2003 |