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