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

Answer key

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

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