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

Answer key

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

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