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