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

Answer key

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

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