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