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

Answer key

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

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