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