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