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

Answer key

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

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