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

Answer key

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

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