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