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