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