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

Answer key

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

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