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