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

Answer key

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

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