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

Answer key

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

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