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

Answer key

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

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