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

Answer key

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

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