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

Answer key

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

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