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