← Images with img, src and alt lesson New set →

HTML Worksheet: Images and Alt Text

HTML and CSS lesson 7: Images with img, src and alt · Set 641 · 40 questions
TalentJR

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

Answer key

  1. False
  2. to describe the image
  3. alt
  4. False
  5. src
  6. map.png
  7. The full moon
  8. height
  9. No
  10. An old fort
  11. False
  12. True
  13. False
  14. Map of India
  15. 350
  16. tiger.jpg
  17. width
  18. A happy dog
  19. 250
  20. Birthday cake
  21. bus.jpg
  22. 50
  23. <img>
  24. 350
  25. True
  26. 350
  27. 150
  28. alt
  29. A red kite
  30. tiger.jpg
  31. map.png
  32. kite.png
  33. True
  34. map.png
  35. 300
  36. Our school bus
  37. The full moon
  38. dog.jpg
  39. A tiger asleep
  40. A tiger asleep

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids