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

Answer key

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

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