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

Answer key

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

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