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

Answer key

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

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