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