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

Answer key

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

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