The localized electromagnetic eigenmodes in a dielectric slab, sandwiched between two semi-infinite dielectric media, are theoretically studied. The transfer matrix formalism is applied for deriving the dispersion relation and electromagnetic field distribution of the localized eigenmodes for both s and p polarization of light. There is an infinite number of localized eigenmodes when the permittivity of the slab has positive sign in either s or p polarization. The latter occurs if the permittivity of the slab is greater than the permittivity of the surrounding media. In contrast, when the slab has negative permittivity there is just one localized electromagnetic eigenmode only for the p-polarization. In his case, the spectrum of the localized eigenmode is determined not only by the negative sign of the slab permittivity, but also by the difference between the permittivity absolute value for the slab and the permittivity of the surrounding medium. In addition, the symmetry of the localized electromagnetic eigenmodes is discussed.