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

Answer key

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

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