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

Answer key

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

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