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