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