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

Answer key

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

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