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