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

Answer key

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

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