The answer is;
A crack forms in oceanic crust.
Volcanoes erupt under the ocean.
Molten rock rises up through the crust.
New material pushes older rock away from the ridge.
Seafloor spreading occurs in divergent boundaries where two tectonic plates are moving away from each other. As the plates diverge, the void is filled up by upweling magma from the mantle. This causes an eruption at the boundaries causing a cascade of mountains along the ridge. Therefore, the closer to the ridge you get, the newer the crust is.