agyanadda@gmail.com

HTML Images

HTML Text & Links 1 min read Updated Nov 30, 2026 Topic 15 of 33

Examples

Example — Images with alt, size and link HTML
<img src="https://www.w3schools.com/html/pic_trulli.jpg"
     alt="White stone houses with cone roofs" width="240" height="160">

<p>Clickable image:</p>
<a href="https://agyanadda.com">
  <img src="https://www.w3schools.com/html/img_girl.jpg" alt="Go to AgyanAdda" width="120">
</a>
Example — Figure with caption HTML
<figure>
  <img src="https://www.w3schools.com/html/pic_trulli.jpg" alt="Trulli houses" width="240">
  <figcaption>Fig 1. Traditional houses in Italy.</figcaption>
</figure>

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which attribute describes the image for screen readers?

Exercise 2 True / False

Setting width and height on images helps stop the page from jumping while loading.

Exercise 3 Fill in the Blank

The image file path goes in the ___ attribute.

Frequently Asked Questions

WebP gives small files with good quality. JPG for photos and PNG for logos also work. Compress them with the AgyanAdda Compress Image tool.