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

Answer key

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

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