The optical refractive index changes and absorption coefficients of quantum wells (QWs) are theoretically investigated with considering exciton effects within the framework of the fractional-dimensional space approach. The exciton wave functions and bound energies are obtained as a function of spatial dimensionality, and the dimension increases with the well width increasing. Then optical properties are obtained by using the compact-density matrix approach and an iterative method. Numerical results are presented for wurtzite ZnO/MgxZn1−xO QWs. The calculated results show that the changes of refractive index and absorption coefficients are greatly enhanced due to the quantum confinement of exciton. And the smaller the QW width (dimension) is, the larger influence of exciton on the optical properties will be. Furthermore, the exciton effects make the resonant peaks move to a lower energy. In addition, the optical properties are related to the QW width, the incident optical intensity and carrier density.