According to the theories of Lamark and Darwin, ancestors of modern giraffe were deer like animals with short neck and small forelimbs. They lived in green grasslands of Africa. Gradually environment changed, climate became dry, grasslands transformed into desert, leaving behind a few tall trees. For survival giraffe had to feed on the leaves of tall trees. For feeding on the leaves of tall trees ancestors of giraffe had to stretch their neck and forelimbs generation after generation. Due to continuous stretching, the length of the neck and forelimbs increased.
According to this theory, the increase in length of neck and forelimbs was an acquired character and it was passed on to the offsprings. This process continued for generations, giving rise eventually to the modern giraffe with its long neck and forelimbs.