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