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