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

Answer key

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

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