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

Answer key

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

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