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

Answer key

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

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