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

Answer key

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

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