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

Answer key

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

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