Giraffes grew their long necks so they were able to head-butt their love rivals, scientists in China have claimed.