UA Home
University Information Technology Services

Adding Graphics & Photos

The img tag is used to add the image to a web page. The code below assumes that the image file is stored within the same directory as the XHTML file that is referencing it:

 

<img src="dog.jpg">

 

GIF Format:

The GIF file format suitable for maps, cartoons, pen & ink illustrations, etc. The gif file format is excellent at compressing areas of solid color with sharp contrast.

 

JPEG Format:

The jpeg file format is suitable for photographic work and illustrations with a lot of detail. jpeg is excellent at reproducing areas of continuous tones of color or colors that fade from one color to the next.

 

The width & height attributes of the img tag determine the size of your graphic image and should always be included in an img tag.

 

<img src="logo.gif"

alt="University of Arizona logo"

width="100" height="100" />

 

Alt Tag

The alt tag or 'alternative text' gives you the ability to place "alternate" messages with your graphics so that users without graphics capabilities can still understand the function of graphics on your pages. The alt tag is mandatory for to make your site accessible to users with disabilities. For more information, see:

 

Graphics & Photo Resources