In this work, the mesoporous carbon was synthesized through volatile organic solvents-organic self-assembly under different ratios of raw materials, using F-127 as template, phenolic resin as carbon source, tetraethyl orthosilicate (TEOS) as silicon source. Morphology and structure of prepared mesoporous carbon were characterized by X-Ray diffraction (XRD), Fourier transform infrared spectroscopy (FT-IR), scanning electron microscopy (SEM) and Transmission electron microscopy (TEM). The optimized condition of ordered structure was obtained by adjusting the different ratios of raw materials. The adsorption performance was investigated by adsorption of ciprofloxacin and tetracycline. A series of adsorption were studied at different initial concentrations from 50 to 500 mg/L, and also the different temperatures from 20 to 50 degrees C with various mesoporous carbons which were fabricated under different ratios of raw materials. The result revealed that the best wight proportion of TEOS, phenolic resin and F127 is 3:0.667:2, and the adsorption rate of tetracycline could reach 98%. Last, the adsorption processes of tetracycline were also discussed.