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

Answer key

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

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