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