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