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