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

Answer key

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

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