A finite-element method is presented that is particularly suited for the computer modeling of three-dimensional electromagnetic fields in inhomogeneous media. It employs a new type of linear vectorial expansion functions. Across an interface where the constitutive coefficients are discontinuous, they have the following properties: (1) the continuity of the tangential components of the electric and the magnetic field strengths is exactly preserved, (2) the normal component of the electric and the magnetic field strengths are allowed to jump and (3) the electric and the magnetic fluxes are continuous within the pertaining degree of approximation. The system of equations from which the expansion coefficients are obtained is generated by applying a Galerkin-type weighted-residual method. Numerical experiments are described that illustrate the efficiency of our elements, and the computational costs of the method.