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