A technique for measuring shapes containing gaps that combines optical fringe scanning with the fractional fringe order method is presented. The basic configuration is a Twyman-Green interferometer with collimated white-light illumination. The reference mirror is moved using a piezoelectric transducer at a phase interval of ?/2 during the measurement, and the fringe image is collected at every step. The surface shape is reconstructed by a four-frame scanning algorithm for each pixel for each selected wavelength. The absolute gap height is then identified by the fractional fringe order method, which can detect the 2? phase jumps accurately. The simultaneous measurement of both a gap of several wavelengths and a surface shape is also demonstrated. Finally, the influences of the spectral bandwidth of light and the central wavelength used in recording interferograms are discussed.