Magnets only repel magnets of
the same polarization, and do not magnetically influence non magnetic
materials. If the material is attracted, it means that the material is
magnetic. If the material is not attracted, it means the material is
non-magnetic.
The magnetic field strength decreases as distance increases. In fact, a
magnet’s power can all but disappear when it’s moved even a slight
distance away from the the object(nail). However, stronger magnets can continue
to influence the direction of the nail from greater distances
away.