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

Answer key

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

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