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