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