Building codes and local codes may regulate the construction of a fence in different ways. It is important to follow building codes and apply for the necessary permits. Contact your local authority or building specialist for advice and to ensure that all requirements are met.