Abiotic and biotic factors have the potential to alter herb communities, however, few studies consider feedback between them. This study explores how variation of species interaction and climatic conditions associated with changes in altitude affect herb community composition. We sampled accumulated temperatures of growth duration (June-November) (ATGD), maximum summer temperatures (MST) and herb community composition (herb height, abundance, richness) on non-gaps and forest-gaps site across an elevational gradient. A significant negative relationship was detected between MST and herb richness. The temperature of non-gaps was cooler than that of forest gaps, and overstory cover positively correlated with herb abundance. However, the ATGD exhibited a negative relationship with overstory cover, in that overstory cover decreased with ATGD. We suggested that temperature has a profound effect on height and richness of herb communities, while the overstory cover is moderating the effect of temperature on herb community structure and influence the abundance of herb community. Conversely, decreases in ATGD weakened the relative importance of overstory cover. We concluded that the interaction of temperature and overstory cover shapes the morphology, abundance and richness of herb communities.