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