The femur is shaped so that it will swing underneath the body. Its upper end, which fits snuggly into the hip socket, is bent sharply inward and has a smooth ball-shaped top so that the bone can pivot freely forward and back. The main length of the bone is more or less straight, though complicated here and there by bumps and ridges where the leg muscles are attached. At the lower end of this bone there is a smooth bearing surface for the knee joint, which is shaped in such a way that the knee will only flex back and forth - just like the humans' knee joint.
The lower leg consists of two bones lying side by side. Both are almost straight. The upper ends form a simple knee hinge with the femur and the lower ends are capped by two ankle bones. The latter are very firmly attached to the lower leg, and form the upper half of the main ankle joint, which again is simple and allows the foot to swing to and fro. The human ankle joint is quite loose compared to that of a dinosaur, so a better example is the ankle of the horse which is very limited and unable to make any sideways movement.
A dinosaurs' foot is quite different from a human one. The long bones (metatarsals) are not nearly parallel with the ground, but are bunched together and run upwards to the ankle joint, so that dinosaurs walk on their toes at all times. The toes tend to be quite long and slender. This gives the foot a firm grip of the ground and helps the dinosaur to balance. The long toes also increase the creatures stride length - and therefore the speed at which it walks or runs - and gives a characteristically narrow foot shape. Nearly all dinosaurs have only three walking toes on the foot.
There are of course exceptions to every rule and some of the very heavy dinosaurs, for example, the giant sauropods Diplodocus and Brachiosaurus have shorter and broader toes, rather like those of an elephant. But, these still show their origin from earlier, narrower and more typical dinosaur feet.
For more Information on the mode of locomotion click on the required topic area: