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

Answer key

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

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