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

Answer key

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

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