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