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