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

Answer key

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

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