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

Answer key

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

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