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