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

Answer key

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

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