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