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