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

Answer key

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

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