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

Answer key

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

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