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