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

Answer key

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

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