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

Answer key

  1. No
  2. 150
  3. dog.jpg
  4. A happy dog
  5. True
  6. 50
  7. A tiger asleep
  8. tiger.jpg
  9. False
  10. bus.jpg
  11. map.png
  12. alt
  13. False
  14. Map of India
  15. A happy dog
  16. 300
  17. 50
  18. 350
  19. False
  20. 150
  21. A happy dog
  22. A tiger asleep
  23. fort.jpg
  24. 400
  25. 150
  26. A red kite
  27. 200
  28. 300
  29. bus.jpg
  30. bus.jpg
  31. bus.jpg
  32. src
  33. 200
  34. True
  35. dog.jpg
  36. alt
  37. A tiger asleep
  38. 50
  39. 50
  40. width

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