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

Answer key

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

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