See also ephebophilia.
It happens to be the case that if you are below this arbitrary age and are attracted to someone of the same age, that this is not considered wrong, but "normal". However, if you even are slightly outside of this age range and are attracted to one within this age range, that is considered not normal, but "wrong".
In the instance of a male 18 years old being attracted to a female 17 years old, this is a more socially acceptable form of ephebophilia. However, there are even some who would argue that since a law is invented by humans, such as having arbitrary but not actual value even, that it is absolute.
Male being attracted to female, such is more natural as mammary glands are indicative of biological adulthood. Female being attracted to male, it is a bit less visually deterministic.
Guy 2: dude, shes younger than the arbitrarily defined age of adulthood, so you're an ephebophile!