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.
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.
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.
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>
Figure 1: A down arrow
Horizontal rule
A horizontal rule, <hr>, is often used to separate a page into a sequence of visual
sections 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. 2016 January — it seems mp3 now plays in Firefox; need confirmation
the web page does not have the ogg source line.