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

Answer key

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

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