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

Answer key

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

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