Quinolone antibiotics are widely used to prevent and treat diseases caused by bacterial infection. However, overuse of antibiotics may lead to their residue in the environment and food, posing potential threats to human health. In this study, a ratiometric fluorescent probe based on nitrogen and sulfur co-doped carbon quantum dots (N, S-CQDs) was synthesized, which can realize the detection of moxifloxacin (MXF), gatifloxacin (GAT) and ofloxacin (OFX) in milk. After addition of these antibiotics, the fluorescence at 440 nm originating from N, S-CQDs was significantly quenched due to the fluorescence resonance energy transfer (FRET), while the fluorescence at 525 nm (MXF), 500 nm (GAT) and 515 nm (OFX) were enhanced due to aggregation induced emission (AIE). The fluorescence changes were completed within 30 s and stabilized for at least 14 days. Good linear relationships between the fluorescence intensity ratios (F525/F440 for MXF, F500/F440 for GAT and F515/F440 for OFX) and the antibiotic concentrations ranging from 0.1 to 100 mg L−1 were obtained, with R2 above 0.99. The limits of quantitation were in the range of 1.67–6.20 μg L−1, and MXF, GAT and OFX can be well identified by linear discriminant analysis. The probe enabled quantitative analysis of MXF, GAT and OFX in milk samples, with recoveries ranging from 82% to 107%. A test strip based on the ratiometric fluorescence probe was successfully applied for the detection of MXF and GAT in milk in combination with a smartphone. This method exerted high specificity and sensitivity, which has the potential to achieve in-site detection of MXF, GAT and OFX in milk.