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

Answer key

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

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