The type of spectrum you're describing is an absorption spectrum.
In an absorption spectrum, specific wavelengths of light are absorbed by a substance and then re-emitted in random directions, which can make those wavelengths appear darker or completely black when the light is viewed in a specific direction (such as through a spectroscope).
The black lines you're seeing are specific wavelengths that have been absorbed by the substance you're observing. The colors of these lines correspond to the energy of the photons that have been absorbed. For example, a black line in the purple part of the spectrum indicates that the substance has absorbed light with a wavelength corresponding to purple light.
This is different from an emission spectrum, where you would see bright lines on a dark background. These bright lines correspond to the specific energies of photons that are being emitted by the substance.
The spectrum is not infrared, as infrared light is not visible to the human eye and would not appear in a visible spectrum.
The term "electromagnetic" refers to the type of waves that light consists of, but it does not specify a particular type of spectrum. Both absorption and emission spectra are types of electromagnetic spectra, as they both involve the interaction of electromagnetic waves (light) with matter.