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

Answer key

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

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