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