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