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