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

Answer key

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

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