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

Answer key

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

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