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

Answer key

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

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