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