Water has a special property that distinguishes it from almost all other liquids. It has its smallest volume at 4 °C and thus its greatest density. This abnormal thermal behaviour of water is known in physics as the anomaly of water.
At temperatures above 4°C, water behaves like other liquids. When the temperature increases it expands, when the temperature decreases its volume decreases. If water cools down below 4°C, its volume increases again to 0°C. If the water then freezes, it expands further. While water at 0°C has a density of about 1g/cm3, ice at 0°C has a density of 0.92 g/cm3.
This is why ice floats on water. The ratio of the densities of ice and water is also the reason why an iceberg is about 9/10 under water and only about 1/10 above water.