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