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

Answer key

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

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