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

Answer key

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

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