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

Answer key

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

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