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

Answer key

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

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