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

Answer key

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

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