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