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

Answer key

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

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