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

Answer key

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

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