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

Answer key

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

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