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