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