HTML Attributes

Many HTML tags have attributes, additional qualifiers which say something extra about the element the tag is describing.

Attributes take the form: attributename="value" inside the tag.

The image tag always needs a "src" attribute that tells the browser where to look for the source of the image to display - the image filename. The tag should also have an "alt" attribute that gives the browser some alternative text to display in case the image source cannot be found or is in error. for example:

<img src="2parrots.jpg" alt="Two parrots in the jungle" />

gives

Two parrots in the jungle

There are many attributes available: most of which are optional. Some attributes are used only with certain HTML tags, but there is a set of HTML core attributes which can be used with any element.