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

Answer key

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

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