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