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

Answer key

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

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