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

Answer key

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

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