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

Answer key

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

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