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

Answer key

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

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