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

Answer key

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

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