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