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

Answer key

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

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