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

Answer key

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

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