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