The correct reason for the stripes of alternating magnetism on the ocean floor is:
Minerals in magma match the magnetic direction present on Earth when it hardens into rock.
This phenomenon is known as magnetic striping and occurs due to the process of seafloor spreading at mid-ocean ridges, where new magma rises and creates new oceanic crust. As the magma cools and solidifies, the iron-bearing minerals within it align with the Earth's magnetic field at that time, preserving a record of the magnetic direction. When the Earth's magnetic field reverses, the new rock that forms will have a different magnetic orientation, resulting in the alternating patterns seen on the ocean floor.