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

Answer key

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

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