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

Answer key

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

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