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

Answer key

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

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