When water freezes, water molecules form a crystalline structure maintained by hydrogen bonding. Solid water, or ice, is less dense than liquid water. Ice is less dense than water because the orientation of hydrogen bonds causes molecules to push farther apart, which lowers the density.
Ice in fact it is solid but it has cage like structure and hence its molecules have more empty space as compared to water so it has smaller density then water and hence floats on water.