Sulfadiazine is an environmental pollutant derived from abuse of antibiotics. Its content in environmental water is closely related to human health. Thus, a novel dual‐emission surface molecularly imprinted nanosensor is designed for the specific adsorption and detection of sulfadiazine. In the system, blue emissive carbon quantum dots wrapped with silica served as the internal reference signal for eliminating background interference, while red emissive thioglycolic acid modified CdTe quantum dots (CdTe QDs), which are low dimensional semiconductor materials by the combination of cadmium and tellurium with excellent optical properties, were encapsulated in the imprinted layer to offer recognition signal. The fluorescence of CdTe quantum dots was quenched and the fluorescence quenching degree of carbon quantum dots was inconspicuous with the increase of concentration of sulfadiazine, thereby reflecting the color change. The detection of sulfadiazine was successfully achieved in a concentration range of 0.25–20 μmol/L with detection limit of 0.042 μmol/L and nanosensors had specific recognition for sulfadiazine over its analogues. Compared to single‐emission fluorescence sensors, ratiometric fluorescence nanosensors had wider linear range and higher detection accuracy. Furthermore, the nanosensors were also successfully applied for the determination of sulfadiazine in real water and milk samples with acceptable recoveries. The study provides a feasible method for the detection of sulfadiazine and a reference for the detection of sulfonamides.