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

Answer key

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

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