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

Answer key

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

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