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