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

Answer key

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

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