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

Answer key

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

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