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