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

Answer key

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

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