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