A series of new triazole derivatives were designed and synthesized on the basis of the active site of lanosterol 14alpha-demethylase from Candida albicans (CACYP51). 2-(2,4-Difluorophenyl)-3-(methyl-(3-phenoxyalkyl)amino)-1-(1H-1,2,4-triazol-1-yl)propan-2-ols show excellent in-vitro activity against most of the tested pathogenic fungi. The MIC(80) value of compound 8a against Candida albicans is 0.01 microM, which provides a good starting template for further structural optimization. The binding modes of the designed compounds were investigated by flexible molecular docking. The compounds interacted with CACYP51 through hydrophobic, van-der-Waals, and hydrogen-bonding interactions.