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