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

Answer key

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

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