Here's why:
* Absorption lines are caused by the absorption of specific wavelengths of light by elements in a star or other celestial object.
* The position of these lines is determined by the energy levels of the electrons in the atoms of these elements.
* The energy levels are intrinsic to the element and do not change with the object's distance.
What does change the position of absorption lines?
* Doppler Shift: This is the change in the observed frequency of light due to the relative motion of the source and observer.
* If the object is moving towards us, the absorption lines will shift towards the blue end of the spectrum (blueshift).
* If the object is moving away from us, the absorption lines will shift towards the red end of the spectrum (redshift).
Distance doesn't directly affect the position of absorption lines. It's the relative motion between the observer and the object that causes the Doppler shift and shifts the absorption lines.