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

Answer key

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

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