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

Answer key

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

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