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