  The present paper has a number of distinct purposes. First is to give a
description of a class of electromagnetic knots from the perspective of
foliation theory. Knotted solutions are then interpreted in terms of two
codimension-2 foliations whose knotted leaves intersect orthogonally everywhere
in spacetime. Secondly, we show how the foliations give rise to field lines and
how the topological invariants emerge. The machinery used here emphasizes
intrinsic properties of the leaves instead of observer dependent quantities -
such as a time function, a local rest frame or a Cauchy hypersurface. Finally,
we discuss the celebrated Hopf-Ra\~nada solution in details and stress how the
foliation approach may help in future developments of the theory of
electromagnetic knots. We conclude with several possible applications,
extensions and generalizations.
