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