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

Answer key

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

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