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

Answer key

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

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