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

Answer key

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

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