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