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

Answer key

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

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