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