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

Answer key

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

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