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