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