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