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