Nanostructuring of magnetic materials, on a scale comparable to the dimensions of the magnetic domain boundaries, is known to have a significant effect on the magnetic properties of a material. Here we demonstrate a simple and versatile technique for the preparation of two- or three-dimensional highly ordered macroporous cobalt, iron, nickel, and nickel iron alloy films containing close packed arrays of spherical holes of uniform size (an inverse opal structure). The films were prepared by electrochemical deposition from aqueous solution within the interstitial spaces of pre-assembled templates. The templates were assembled from colloidal polystyrene latex spheres (0.20, 0.50, 0.75 or 1.00 µm in diameter) assembled onto gold electrode surfaces from aqueous solution by slow evaporation. Following the electrochemical deposition of the metal or alloy films the polystyrene templates were removed by dissolution in toluene. Scanning electron microscopy of the resulting films show well-formed two- or three-dimensional porous structures consisting of interconnected close packed arrays of spherical voids. X-Ray diffraction analysis confirms that the nickel iron alloy in the walls of the structure is polycrystalline fcc in structure with a grain size which is significantly smaller than the thickness of the walls. The diameter of the spherical voids within the structures can be varied by changing the diameter of the polystyrene latex spheres used to form the template. Studies of the magnetic properties of the macroporous films show a large coercivity enhancement in comparison to the corresponding plain films and we find that the coercive field gradually increases as the diameter of the spherical voids decreases for films of a constant thickness.