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