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