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

Answer key

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

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