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