The answer is; The cloud is cool and lies between you and a hot star.
Absorption lines occur when the electrons of an atom absorb energy through a specific wavelength of light and the electrons ‘jumps’ from a lower energy level to a higher energy level. Absorption lines are viewed as black lines in a continuous spectrum