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