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

Answer key

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

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