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

Answer key

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

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