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

Answer key

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

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