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

Answer key

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

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