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