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

Answer key

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

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