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

Answer key

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

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