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

Answer key

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

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