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