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

Answer key

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

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