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

Answer key

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

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