Fencing laws work to keep livestock off highways and safe on their owner's property. At a time when everyone owned livestock, it was a simple matter of sharing the cost of building and maintaining a fence. Today, the rules are complicated, but still revolve around the "Right-Hand Rule" in most states. If two neighbors are both running animals on their farms, they stand on their side of the fence and face it. The fence to their right, from its midpoint to the outside corner, is their responsibility. The fence on the left is the neighbor's. If the neighbor doesn't have livestock, then the owner who does have animals must build and maintain the entire fence between the properties.
It seems logical that the purpose of fencing laws is to keep a landowner's livestock fenced in on his property to protect them. In some states with open range, or fence-out, laws, the opposite is the case. If you don't want animals on your property, then it's your responsibility to build fences to keep them out. That's not to say the animals can run anywhere. The owner does have a responsibility to keep the animals off roads and to know where they are.
Most municipalities regulate the height of fences to 4 feet for front yards and 6 feet for backyards. Unless the fence is one adjoining neighbor's "build and share," it should be set inside the property lines of its owner. Since privacy fences may hinder the line of sight of neighbors, it's a good idea to build the fence in such a manner as to cause the least offense to adjoining property owners. In almost all municipalities the "pretty side" of the fence, or the flat side, faces away from the property.
The most common type of safety fences are those built around backyard swimming pools. These fences should be at least 4 feet tall. The openings in the fencing should be no larger than 4 inches in diameter. All horizontal cross-members of the fence should be on the inside of the structure to prevent young children from using them as steps to help them climb the fence. Pool safety fences must also have a safety gate on them that only latches from the inside of the fence. The latch must be high enough that toddlers can't reach the latch and open it.