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