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

Answer key

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

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