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

Answer key

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

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