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