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

Answer key

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

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