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