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