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

Answer key

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

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