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

Answer key

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

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