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

Answer key

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

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