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

Answer key

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

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