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