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

Answer key

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

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