Thin films of organic-inorganic hybrids (CnH2n+1NH3)2PbX4(X=Cl, Br, I; n=4,6,8,10) were prepared by the spin-coating method. The influences of annealing temperature on the crystal structure of the films were analyzed by X-ray diffraction(XRD). The surface morphology of the films were observed using scanning electronic microscope(SEM). The room-temperature UV-Vis absorption spectra of the films were employed to examine the effect on the optical properties of different elements X (X=Cl,Br,I), and varying n from 4 to 10, respectively. The results showed that a significant red shift of the absorption peak was observed for different X in inorganic layers, and the position of the exciton absorption peaks did not shift obviously with the increasing of the alkyl chain length in organic layers. The results suggested that the exciton absorption arise from electronic transitions within the inorganic layer, rather than from the organic layer.