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

Answer key

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

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