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

Answer key

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

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