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

Answer key

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

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