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

Answer key

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

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