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