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

Answer key

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

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