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

Answer key

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

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