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

Answer key

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

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