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

Answer key

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

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