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

Answer key

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

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