However, there are some exceptions to this rule. For example, ice is less dense than water because the hydrogen bonds between water molecules cause them to form a more open structure when they freeze. This means that ice has a lower mass per unit volume than water, so it floats on top of water.
Similarly, cork and wood are both less dense than water because they contain a lot of air pockets. These air pockets reduce the mass of the cork and wood, so they can float on top of water.