It is easy to place an image on your page using the <img> tag. For example, to place the Sequoia Seal on your page, you
would save the image file in your images folder and use the following image tag:
<img src="images/logo.gif" />
To practice displaying images with the Sequoia Seal, you will first need to save the image to your images folder. Right-click on the image above and choose Save Image As. Find your images folder and click on Save.
Attributes to Use with the Image Tag
Attribute | Purpose and Syntax | Values |
src | Designates the filename for the image <img src="images/logo.jpg" /> | Directory/Filename of Image |
width | Sets the width of the image <img width="125" /> | Width in pixels |
height | Sets the height of the image <img height="125" /> | Height in pixels |
border | Sets the border size <img border="1" /> | Border size in pixels |
alt | Assigns alternate text to the image that text-only browsers can see <img alt="Image of Sequoia's Seal" /> | Descriptive text |
The image tag does not have a closing tag - even though it has attributes. However, XHTML requires a closing "/" in the tag. |
Background Images
The <body> tag is used to display a tiled background on a web page (instead of a color). The attribute for
background is: <body background="images/stucco.gif">. Tiled images are small graphics that are printed across the page multiple times.