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