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

Answer key

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

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