The diversity of fungi along environmental gradients has been little explored in contrast to plants and animals. Consequently, environmental factors influencing the composition of fungal assemblages are poorly understood. The aim of this study was to determine whether the diversity and composition of leaf and root-associated fungal assemblages vary with elevation and to investigate potential explanatory variables. High-throughput sequencing of the Internal Transcribed Spacer 1 region was used to explore fungal assemblages along three elevation gradients, located in French mountainous regions. Beech forest was selected as a study system to minimise the host effect. The variation in species richness and specific composition was investigated for ascomycetes and basidiomycetes assemblages with a particular focus on root-associated ectomycorrhizal fungi. The richness of fungal communities associated with leaves or roots did not significantly relate to any of the tested environmental drivers, i.e. elevation, mean temperature, precipitation or edaphic variables such as soil pH or the ratio carbon∶nitrogen. Nevertheless, the ascomycete species richness peaked at mid-temperature, illustrating a mid-domain effect model. We found that leaf and root-associated fungal assemblages did not follow similar patterns of composition with elevation. While the composition of the leaf-associated fungal assemblage correlated primarily with the mean annual temperature, the composition of root-associated fungal assemblage was explained equally by soil pH and by temperature. The ectomycorrhizal composition was also related to these variables. Our results therefore suggest that above and below-ground fungal assemblages are not controlled by the same main environmental variables. This may be due to the larger amplitude of climatic variables in the tree foliage compared to the soil environment.