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

Answer key

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

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