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

Answer key

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

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