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