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

Answer key

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

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