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

Answer key

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

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