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