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