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