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