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

Answer key

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

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