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

Answer key

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

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