HTML · Links and media

img

Embeds an image. alt describes the image for people who cannot see it and for search engines.

Syntax
<img src="…" alt="…">

Example

Try it

Notes

Always set width and height to reserve space and avoid layout shift. Use alt="" only for purely decorative images.

More in this group

a area audio canvas embed figcaption figure iframe

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course