I was trying to build a fence around an area made of sand for my animals and when I placed the fence down, the fence was floating above the ground. I tested the fence on dirt and the same thing happens. I also made more fence and the new fence still floated.
UPDATE: I clicked on the fence and they opened like a gate. I also checked and made sure I used the correct recipe in my crafting table and I did.