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

Answer key

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

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