Divergent boundary and trenches between oceanic plates
The elevation of oceanic crust is controlled by Pratt isostasy, whereby hotter crust is elevated because it is less dense. Oceanic crust is produced at mid-ocean ridges and cools as it moves away from the ridge. Mid-ocean ridges are hot and therefore they are elevated above the colder, more dense adjacent crust.

In continental rifts, the dominant process controlling the topography is normal faulting, which leads to subsidence of the rift valley floor and uplift of the sides, leading to the formation of mountains either side of the active rift. Continental rifts form valleys because they have not yet reached isostatic equilbrium and their topography is controlled by extensional faulting.