One anomalous property of water is that when in its solid phase (ice) it is less dense than when it's in its liquid phase. This arises because of the hydrogen bonding network that exists between water molecules. In ice, the structure the solid adopts is an open-lattice structure. An open lattice structure has water molecules being held reasonably far apart from each other to create the most stable configuration, with efficient hydrogen bonding taking place that hold the molecules together effectively. Upon melting, these hydrogen bonds that exist between the water molecules break, and the open-lattice structure comes apart as a result. Because of this, the water molecules become closer to each other and take up less volume. Density is defined as the mass of a substance per unit volume and so a smaller volume occupied will mean a denser substance. This is why ice floats on water.