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

Answer key

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

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