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

Answer key

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

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