We propose a quantitative electrostatic theory of the gate-induced confinement of two-dimensional electron gas (2DEG) in the quantum Hall regime. The self-consistent electrostatic potential in the region occupied by 2DEG changes in a steplike manner due to the formation of alternating strips of compressible and incompressible electron liquids. We obtain the dependence of positions and widths of these strips on the filling factor. Incompressible strips are shown to be much more narrow than the compressible ones. The relationship between the widths of the adjacent compressible and incompressible strips is found to be universal: It does not depend on the strip number, magnetic field, or gate voltage. Our theory enables us to explain results obtained in experimental studies of edge-state equilibration.