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