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