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

Answer key

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

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