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

Answer key

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

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