Designs vary widely, but just about all fences consist of the same basic elements: A series of posts sunk into the ground and connected by rails-top, bottom, and usually in the middle as well; and fencing boards or panels that are nailed to the rails to give the fence its character. Privacy fences usually require 4x4 posts. Rail and fencing lumber can be almost any size. Lumber yards sell prefab sections of fence in many styles, but custom design and construction usually yield a better-looking fence.
Before proceeding, check community building and zoning codes. Many specify maximum fence height, distances you can build from property lines and the street, and even the materials you can and can't use. Once you've chosen a design and established a location, stake out and measure the site. Plot post spacing for the most efficient use of lumber. Six- or seven-foot spans usually work well; never set privacy-fence posts more than 8 feet apart. If you're building your fence on a slope, plan to step the fence down the hill, setting each section lower than the one preceding it. Only if the slope is slight --and the fence design won't suffer -- should you follow the contour.
When you order lumber, specify construction-heart redwood or cedar or ground-contact, pressure-treated wood for all posts and bottom rails; upper rails and fencing can be less expensive grades of rot-resistant lumber. To minimize rust, buy hot-dip galvanized nails and fittings. If you want to paint or stain your fence, apply the finish to posts, rails, and fencing before you nail up the fencing. Besides saving time, you'll get better coverage.