Do chemical compounds have spectral lines, or only elements?
Yes, but for "spectral lines" the gaseous state would generally be the implication. In solids and liquids photon interactions are generally over "bands" of energy not a very discrete wavelength as in a "spectral line."