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