Installing a fence on uneven ground can be simple, and the fence can be made perfectly straight with the proper reference line. Staking it out and attaching a string with a slide level is the best way. It will provide references all the way around as long as all of the runners on the fence are the same distance from the line.
To get a perfectly level fence around the backyard of the home, find the lowest spot where the fence will be installed. If it's hard to tell because it's a gradual drop, start at any point. Install a 3-foot wooden stake about a foot into the ground at the beginning point for the fence. Place another stake at the first 90-degree turn. Tie a string securely to the stake about 1 foot from the ground. Hang a line level on the string. Attach the other end of the string to the second stake and level the line. Continue this procedure around the yard. Once done, it will be obvious where the low and high spots are.
Dig a trench as necessary around the yard keeping 1 foot from string to ground. If the first stake was 1 foot off the ground start there and dig as necessary to keep 1 foot clearance along the stake line. Install the first 4- by 4-inch pole by using a post hole digger at the first stake. Do not fill the hole in or anything yet. Get the first 6- by 8-inch fence panel and sit it on 1- by 2-inch stakes laid so that the fence is 1 inch off the ground. Dig the hole for the post so that the post rises 1 inch above the horizontal top runner on the fence. Center the post in the hole and fill the hole.
Putting Up the Fence
Make sure to level it on both sides and that the flat is perfectly against the fence so that it is not turned. Place a 1-by-2 inch board in the ground at the next 90-degree turn. Attach the string to the 4-by-4 inch post at the top and run it to the 1-by-2 inch board. Level the line and make it tight. Go back to the first 4-by-4 inch post and mark the spot for the second 4-by-4 inch post. Make sure that the section of the fence is flush on the 90-degree side and contacts the next 4-by-4 inch post in the middle of the post when the mark is made. Use spray paint or a stake at the spot for the next 4-by-4 inch post.
Dig the hole for the next 4-by-4 inch post deep enough so that the top of the post is level with the string. Level it and fill the hole. Level the first section of fence and keep it 1 inch off the ground but also the same level above the string. As long as the fence is the same level from the string all the way around the yard, it will be perfect. Some digging may be necessary to keep the 1-inch-above-the-ground rule. Hold the next section of fence in place and mark the next post hole location. Continue in this manner until the entire fence is up.