
Note that most of the metal lines (to an astronomer, the periodic table is H, He and metals) in the star are also seen in the galaxy spectrum. However, the galaxy line centers are redshifted (expanding Universe) and the galaxy lines are broader due to Doppler effects from the motion of the stars in the gravitational well of the galaxy.