Last updated 2013 December 2

Image element

Images are specified with the image element img where the file containing the image is referenced with a URL similar to an anchor link. Image elements do not have an end tag.

    <img src="../images/arrowDown.gif">
    <img src="http://abc.def.com/images/arrowDown.gif">

The default size of an image is typically either too big or too small to be displayed appropriately in your web page. As a consequence, you can change the size of the image by specifying its height and width attributes in pixels.

    <img src="../images/arrowDown.gif" height=19 width=120>

If you are not sure the image will be found, for example, a page is displayed but there is no internet connection to get a remore image or it is a broken link, then you specify a texttual alternative for the image that is displayed in place of the image.

    <img src="../images/arrowDown.gif" alt="Down arrow">

     Down arrow

Figure and figcaption elements

An image can be placed within a figure element and then you can include an optional figcaption element. Note the <br> element after theimage element. It puts the caption below the image. Without the <br> element the caption would follows the image.
<figure>
    <img src="../images/arrowDown.gif" alt="Down arrow"> <br>
    <figcaption>
        Figure 1: A down arrow
    </figcaption>
</figure>
Down arrow
Figure 1: A down arrow

Horizontal rule

A horizontal rule, <hr>, is often used to separate a page into a sequence of visual secitions as shown below. A horizontal rule does not have an end tag.

Meter element

Meter element shows a "progress bar" that is hardcoded to show the current value between a minimum and maximum value. NOTE: in Safari and Firefox on a Mac the text between the start and end tags is not displayed.

    <meter value=52 min=10 max=90></meter> The meter value is 52, the minimum is 10 and the maximum is 90

The meter value is 52, the minimum is 10 and the maximum is 90

Progress bar element

The progress bar element shows a progress bar. The element is hardcoded to show the current value between 0 (default) and maximum value. NOTE: in Safari and Firefox on a Mac the text between the start and end tags is not displayed.

    <progress value=52 max=90></progress> The progress value is 52 and the maximum is 90.

The progress value is 52, the minimum is 0 (default) and the maximum is 90

Audio element

The audio element <audio> is used for playing audio files and may display a minimal media player user interface. NOTE: Firefox can only deal with ogg format, as there is a licensing issue with mp3 use in browsers. However mp3 works in Safari.
<audio controls="controls">
    <source src="mp3/button-2.mp3" type="audio/mpeg">
    <source src="mp3/button-2.ogg" type="audio/ogg">
    <a href="mp3/button-2.mp3">Load button-2.mp3</a>
</audio> Button-2 sound
Button-2 sound

For Firefox do not use the audio element. Instead just use the anchor link. The minimal media player user interface is displayed on a new page.

Load audio for <a href="mp3/button-2.mp3">button-2</a> in mp3 format for Firefox use

Load audio for button-2 in mp3 format for Firefox use