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

Answer key

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

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