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

Answer key

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

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