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

Answer key

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

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