We present a method to measure continuous-wave ferromagnetic resonance (FMR) spectra based on the core-level absorption of circularly polarized x rays. The technique is demonstrated by using a monochromatic x-ray beam incident on an yttrium-iron-garnet sample excited by a microwave field at 2.47 GHz. FMR spectra are obtained by monitoring the x-ray absorption intensity at the photon energy corresponding to the maximum of the magnetic circular dichroism effect at the iron L2,3 edges as a function of applied magnetic field. The x-ray FMR signal is shown to be energy dependent, which makes the technique element sensitive and opens up new possibilities to perform element-resolved FMR in magnetic alloys and multilayers. © 2005 American Institute of Physics.