Cave dwellings are common in certain areas of northern China where they serve as homes for more than 40 million people. In the provinces of Shaanxi and Shanxi where the yellow earth (called loess) is quite compacted, cave houses have been in use for centuries.
There are two main kinds of cave dwellings, the first type of cave dwellings are those carved out of the side of a cliff. Cliffside dwellings are often south-facing, and the facades are sometimes faced with bricks or stone. The second type of cave dwelling is built where there are no hills. In this situation, people create sunken courtyards. After digging a courtyard that is usually about 10 meters deep, rooms are dug off the main courtyard. A large sunken courtyard complex, or pit dwelling, can have a courtyard as large as one hundred square meters.