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

Answer key

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

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