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