Electromagnetic waves are the waves composed of electric field and magnetic field propagating perpendicular to each other in straight line.
Electromagnetic waves not only moves through matter but through space also.
For example: Sun rays are also consist of electromagnetic waves. This waves after travelling through the space reaches down to the earth which simply proofs that electromagnetic waves moves through space and matter both.