Antibiotics can kill bacteria, but their continued use can easily lead to drug resistance, particularly the main pathogenic bacteria of periodontitis, Porphyromonas gingivalis. However, to avoid drug resistance, carbon quantum dots (CDs) have great potential as a bioactive material in antimicrobial therapy. Herein, we use ornidazole as raw material to prepare CDs of different sizes by microwave irradiation and screen CDs with fluorescence and bacteriostatic properties. The inhibition experiments and live/dead assays of P. gingivalis exhibited outstanding antibacterial effects. This research aimed to develop nano-level antibacterial active materials that also have fluorescence traceability. This study offers a different method for the development of multifunctional CDs, provides valuable strategies for the treatment of diseases associated with P. gingivalis, and predicts great application prospects in the field of biomedicine.