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

Answer key

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

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