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