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

Answer key

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

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