A magnetic sensor includes a single substrate, a conventional GMR element
formed of a spin-valve film including a single-layer-pinned fixed
magnetization layer, and a SAF element formed of a synthetic spin-valve
film including a plural-layer-pinned fixed magnetization layer. When the
spin-valve film intended to act as the conventional GMR element and the
synthetic spin-valve film intended to act as the SAF element are
subjected to the application of a magnetic field oriented in a single
direction at a high temperature, they become giant magnetoresistive
elements whose magnetic-field-detecting directions are antiparallel to
each other. Since films intended to act as the conventional GMR element
and the SAF element can be disposed close to each other, the magnetic
sensor which has giant magnetoresistive elements whose
magnetic-field-detecting directions are antiparallel to each other can be
small.