In this paper, we investigate the crab gaits of a quadruped. Some important characteristics that simplify the analysis of crab gaits are presented, and several formulas for optimizing the longitudinal gait stability margin of a quadruped crab gait are derived by incorporating the time weighting factor. The analysis and implementation of the gait have been simplified by employing a pseudo-world coordinate frame as a reference frame for describing footholds and vehicle's motion. We also suggest a unique gait which optimizes gait stability margin according to the range of crab angle. Finally, we consider the effects of variations of footholds on stability and maximum permissible stroke in terms of support boundary angle. The results derived in this paper contain previous works on the forward walking gait as a special case of the crab gait.