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

Answer key

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

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