Images with and without captions

To include an image in your HTML file, use the following code:

<img alt="Description of picture" src="image.jpg">

If you’d like your image to have a caption, use a figure element:

<figure>
    <img alt="Description of picture" src="image.jpg">
    <figcaption>Caption for picture</figcaption>
</figure>

You may wish to add a class to your figure element for easy styling:

<figure class="example">
    <img alt="Description of picture" src="image.jpg">
    <figcaption>Caption for picture</figcaption>
</figure>

You can then style your image and caption using .example, .example img, and .example figcaption in your stylesheet.