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

Answer key

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

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