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

Answer key

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

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