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

Answer key

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

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