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

Answer key

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

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