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

Answer key

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

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