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