</> ConvertAtlas Developer Tools
Building Content Lesson 6 Beginner 12 min

Images and Multimedia

Add images, figures, audio and video — and why the alt attribute matters so much.

Pages come alive with images and media. HTML makes adding them easy — but there is one attribute, alt, that beginners skip and professionals never do. Let us get it right from the start.

The image element

Images use the <code>&lt;img&gt;</code> element. It is self-closing — there is no <code>&lt;/img&gt;</code>. The <code>src</code> attribute is the image file, and the <code>alt</code> attribute is a text description. Here is the anatomy.

<img src="cat.jpg" alt="A sleeping cat">
  • Element<img>
  • Sourcesrc="cat.jpg"
  • Alt textalt="A sleeping cat"
HTML · editable
A live image with width and height set.

Why alt text is essential

The alt attribute describes the image in words. It is read aloud by screen readers for blind users, shown if the image fails to load, and used by search engines to understand the image. Every meaningful image needs descriptive alt text. For purely decorative images, use an empty <code>alt=""</code> so screen readers skip them.

alt is not optionalNever leave out alt. Missing alt text is one of the most common accessibility failures on the web — and it hurts your SEO too.

Width, height and why they matter

Setting <code>width</code> and <code>height</code> attributes lets the browser reserve the right space before the image loads. This prevents the page from "jumping" as images appear — a real annoyance and a measured part of page quality. Always include them.

Figures and captions

When an image needs a visible caption, wrap it in <code>&lt;figure&gt;</code> and add a <code>&lt;figcaption&gt;</code>. This semantically ties the caption to the image.

HTML · editable

Audio and video

HTML can embed media directly with <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code>. Add the <code>controls</code> attribute to show play, pause and volume controls.

HTML · editable
A video element (the source file is illustrative).
Try it yourself: a captioned image

In the editable image example, change the alt text to describe a photo of your choice, and change the width and height. Then turn it into a figure with a caption.

Quick quiz

1. Which attribute describes an image in words?

2. Why set width and height on images?

3. How should a purely decorative image set alt?

4. Which element pairs an image with a visible caption?

Key takeaways
  • Images use the self-closing <img> element with src and alt.
  • Always write descriptive alt text (empty alt="" for decorative images).
  • Set width and height to prevent the page jumping as images load.
  • Use figure + figcaption for captions; audio/video embed media.