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