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