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

Answer key

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

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