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