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

Answer key

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

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