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