Rocks are heavier than water. The water from the oceans gets in whatever cracks are present between the rocks, but there’s a lot more water than there’s space in the cracks, so the oceans “float” on the Earth’s crust because it’s made of rock.
Similarly, the air “floats” on the water and the rocks too.
Gravity pulls everything down, the heaviest things will be at the bottom, displacing and pushing up the lighter things.
Latest Answers