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

Answer key

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

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