The floating of an objet in a fluid depends on
density of object as well as fluid
If the density of body is more than that of liquid, the body sinks and if it is less than that of the density of the liquid, the body floats.
So, floating of an object depends on the density of the object as well as the density of the fluid.