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

Answer key

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

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