HTML Worksheet: Images and Alt Text
Code tip (File and words): <img src="file.jpg" alt="what it shows" width="200"> — no closing tag. src = which file to load; alt = words describing it; width / height = size in pixels. If the picture fails, the browser shows the alt text; screen readers read it aloud.
NameDateTime takenScore ___ / 40
- 1.🖼️ Which tag puts a picture on a page? (a) <p> (b) <a> (c) <pic> (d) <img>
- 2.🖼️ Does <img> need a closing tag? (a) No (b) Yes
-
3.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="100"> (a) tiger.jpg (b) A tiger asleep (c) map.png (d) kite.png - 4.🖼️ Which attribute of <img> is read by screen readers? (a) src (b) alt (c) height (d) width
- 5.🖼️ Which attribute of <img> tells which image to load? (a) alt (b) height (c) width (d) src
-
6.🖼️ How many pixels wide is the picture drawn?
<img src="dog.jpg" alt="A happy dog" width="400"> -
7.🖼️ Which picture file does the browser load?
<img src="moon.png" alt="The full moon" width="100"> (a) bus.jpg (b) fort.jpg (c) moon.png (d) The full moon - 8.🖼️ Which attribute of <img> describes the picture? (a) src (b) width (c) height (d) alt
-
9.🖼️ How many pixels wide is the picture drawn?
<img src="moon.png" alt="The full moon" width="50"> -
10.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="400"> (a) tiger.jpg (b) map.png (c) kite.png (d) A tiger asleep -
11.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="350"> (a) width (b) Birthday cake (c) A happy dog (d) cake.jpg - 12.🖼️ Which attribute of <img> sets how wide it is? (a) alt (b) width (c) height (d) src
- 13.True or false: in <img>, alt describes the picture. (a) False (b) True
-
14.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="200"> (a) width (b) cake.jpg (c) A happy dog (d) Birthday cake -
15.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="150"> (a) width (b) bus.jpg (c) An old fort (d) Our school bus - 16.True or false: in <img>, width shows if the image fails. (a) False (b) True
-
17.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="dog.jpg" alt="A happy dog" width="200"> (a) dog.jpg (b) The full moon (c) A happy dog (d) width - 18.🖼️ Why do we add alt text to an image? (a) to make it bigger (b) to describe the image (c) to colour it (d) to load it faster
-
19.🖼️ How many pixels wide is the picture drawn?
<img src="fort.jpg" alt="An old fort" width="200"> -
20.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="map.png" alt="Map of India" width="400"> (a) Birthday cake (b) map.png (c) Map of India (d) width -
21.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="100"> (a) Map of India (b) A red kite (c) width (d) kite.png -
22.🖼️ Which picture file does the browser load?
<img src="map.png" alt="Map of India" width="100"> (a) map.png (b) dog.jpg (c) Map of India (d) cake.jpg -
23.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="350"> (a) Our school bus (b) width (c) An old fort (d) bus.jpg -
24.🖼️ Which picture file does the browser load?
<img src="bus.jpg" alt="Our school bus" width="200"> (a) fort.jpg (b) Our school bus (c) tiger.jpg (d) bus.jpg - 25.True or false: in <img>, src is read by screen readers. (a) False (b) True
- 26.🖼️ Which attribute of <img> sets how tall it is? (a) height (b) width (c) alt (d) src
-
27.🖼️ Which picture file does the browser load?
<img src="tiger.jpg" alt="A tiger asleep" width="350"> (a) tiger.jpg (b) A tiger asleep (c) map.png (d) kite.png - 28.True or false: in <img>, width sets how wide it is. (a) False (b) True
-
29.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="350"> (a) Map of India (b) width (c) A red kite (d) kite.png - 30.True or false: in <img>, height tells which image to load. (a) False (b) True
-
31.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="200"> (a) width (b) A red kite (c) Map of India (d) kite.png - 32.True or false: in <img>, width names the picture file. (a) True (b) False
- 33.True or false: in <img>, height is read by screen readers. (a) False (b) True
- 34.🖼️ Which attribute of <img> names the picture file? (a) width (b) height (c) src (d) alt
- 35.True or false: in <img>, width tells which image to load. (a) True (b) False
-
36.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="250"> (a) An old fort (b) width (c) bus.jpg (d) Our school bus -
37.🖼️ Which picture file does the browser load?
<img src="dog.jpg" alt="A happy dog" width="200"> (a) moon.png (b) dog.jpg (c) bus.jpg (d) A happy dog -
38.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="cake.jpg" alt="Birthday cake" width="250"> (a) width (b) cake.jpg (c) A happy dog (d) Birthday cake -
39.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="kite.png" alt="A red kite" width="400"> (a) A red kite (b) kite.png (c) Map of India (d) width -
40.🖼️ The picture cannot load. Which text does the browser show instead?
<img src="bus.jpg" alt="Our school bus" width="200"> (a) An old fort (b) Our school bus (c) width (d) bus.jpg
Answer key
- <img>
- No
- tiger.jpg
- alt
- src
- 400
- moon.png
- alt
- 50
- tiger.jpg
- Birthday cake
- width
- True
- Birthday cake
- Our school bus
- False
- A happy dog
- to describe the image
- 200
- Map of India
- A red kite
- map.png
- Our school bus
- bus.jpg
- False
- height
- tiger.jpg
- True
- A red kite
- False
- A red kite
- False
- False
- src
- False
- Our school bus
- dog.jpg
- Birthday cake
- A red kite
- Our school bus
Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids