All questions of floating and swimming and flying depend on the comparative differences between various things as regards gravitation. Iron is heavier than water, or as we say, its specific gravity is greater than that of water. Iron must therefore sink in water. Mercury is heavier than water and therefore mercury must sink in water.
But mercury is heavier than iron, and it must therefore sink in iron, which is just a peculiar way of saying that the iron must float on mercury! The thing with the highest specific gravity is the thing for which the earth has the strongest pull. It therefore gets nearest to the earth, and anything else must float on top of it.
Mercury (element) (Wikipedia)