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