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

Answer key

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

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