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

Answer key

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

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