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

Answer key

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

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