Home Tutorials HTML Tutorial Images
Images

Images


11. Images

The <img> element embeds images in HTML documents and commonly uses src and alt attributes. The alt text is important for accessibility and for cases where the image cannot load.

Syntax

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

Example

<img src="flower.jpg" alt="Red flower" width="200">

Output

An image named flower.jpg appears with a width of 200 pixels; if it fails to load, the text Red flower is used as alternative text.
Example

🏋️ Test Yourself With Exercises

Take our quiz on Images to test your knowledge.

Browse Quizzes »