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

Answer key

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

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