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

Answer key

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

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