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

Answer key

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

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