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

Answer key

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

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