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

Answer key

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

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