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

Answer key

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

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