We calculate energies and oscillator strengths of infrared transitions between ground and excited shallow acceptor states in quantum wells (QW's) for varying well width. The impurity states are calculated within a four-band effective-mass theory, which accounts for the valence-band mixing as well as for the mismatch of the band parameters and the dielectric constants between well and barrier materials. The envelope function is expanded into a basis set consisting of products of two-dimensional hydrogeniclike functions and impurity-free QW eigenfunctions at k parallel-to = 0. The present method is suited for s-type ground states as well as for p-type excited states. We obtain the absorption spectra for well widths ranging from 50 to 200 angstrom. We find an overall increase of the transition energies for decreasing well widths. For polarization in the layer planes, the oscillator strengths of the lines corresponding to the bulk G and D lines maintain their oscillator strengths for decreasing well widths, whereas the lines corresponding to the bulk C line are very weak for small well widths. On the other hand, in the case of polarization along the QW axis, the oscillator strengths of the main lines decrease considerably as the well width decreases. We compare our results with absorption spectra of a recent experiment, and find a fairly good agreement.