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