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