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

Answer key

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

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