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