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

Answer key

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

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