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