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