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