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

Answer key

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

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