catcode.com > Guide to Images > The <image> element

Putting an image into your HTML

Even if you've made the right choice for your file format, it's still possible to hurt your page's performance by making some common mistakes with your HTML tags.

To put an image into your document, you use the <img> element, which has this form:

<img src="path" />

the src is the source of the image information, and the path you specify is the path and filename where the image file resides.

The blank and slash before the closing > sign in the tag above will make it compatible with XHTML, the latest and greatest version of HTML. Older browsers will ignore the slash, but only if you leave the blank before it!

We could display a picture of a cat along with text as follows:

Here is a picture of Tabitha, the cat.
<img src="tabitha.jpg" />

(This presumes that the image file is in the same directory as the file containing the HTML above.)

While this is certainly the simplest way to insert an image, it is not the best way.

<< Scanned Images
^ Index