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