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