Gravity pulls downwards. There is another big force in the world which pushes upwards, and this is in water.
Upthrust of water keeping duck afloat
Copyright John Kennedy
Upthrust of water keeping duck afloat
Copyright John Kennedy
Have you ever tried to push a balloon (a blown-up one) under water and keep it there? Do you feel a force pushing up against you? This force is called upthrust or buoyancy. What happens when you let it go? It is this upthrust that keeps ships floating. Otherwise gravity would pull them down under the water.