Erecting a fence on sloping ground means stepping the panels or rails down in stages. The depth of the step very much depends on the severity of the slope.
If the slope is a steep one, rather than have huge gaps under the panels it is better to dig out some of the slope and drop the end of the panel into the "trench". However fences are not made to go underground and in these situations a gravel board is fitted between the posts.
A garden wall is built in exactly the same way when the foundations are laid onto sloping ground and the information for these projects may help you to understand the principles of stepping fencing to slopes.
The posts are dug and concreted in exactly the same way as a fence on flat ground and it is important that the top of the fence panel stays level. If the top of the fence panel is sloping then the post will have to slope also and this looks horrible.
As you can see from the image, gravel boards have been fitted between the posts. These boards must be treated with a rot preserver of some kind to stop the soil rotting them. They can be dug into the slope if necessary. It is not advisable to place any part of the actual fence panel into the ground.
Capping rails are placed on top of the panels to finish the fence off. Always remember to use a string line with your fence just as shown in the fencing to flat ground project. As with other types of fencing the top of the posts can be cut off level with the fence itself or a few inches can be left sticking up above the panels. Post caps can be fitted to the top of the posts to stop water sitting on them and rotting the timber. Post caps act just like coping stones on a garden wall.