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

Answer key

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

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