Final answer:
The mutation for long necks to be inherited in giraffes was caused by natural selection, which favored individuals with longer necks that could reach higher leaves. This process of gradual change over time is a key mechanism of evolution.
Step-by-step explanation:
The type of environmental factor that caused the mutation for long necks to be inherited in giraffes is natural selection.
According to the concept of natural selection, individuals with traits that give them an advantage in their environment are more likely to survive and reproduce. In this case, the giraffe with the longer neck had an advantage in accessing leaves higher up on trees, which provided more food. As a result, this individual was more likely to survive and pass on the long-neck trait to its offspring. Over time, all giraffes became long-necked due to the selective pressure of the environment.
This process of gradual change in a species over time, driven by environmental factors and the resulting survival and reproduction of individuals with advantageous traits, is a key mechanism of evolution.