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

Answer key

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

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