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