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