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

Answer key

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

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