Ceftazidime (CF) is an antibiotic, used in treatment of many serious bacterial infections. Determination of this antibiotic is essential because of its dangerous side effects. This work introduces a novel sensitive optical nanosensor based on carbon dots (CDs) synthesized using citric acid through bottom-up method, embedded in silica molecularly imprinted polymer (SMIP). This probe was made by embedding CDs as fluorophore materials, and ceftazidime as a template molecule in SMIP then washing the template molecules to provide CDs embedded in SMIP (CDs-SMIP). The synthesized materials were characterized by UV–vis (UV/Vis), fluorescence spectrophotometry, Fourier transform infrared spectrometry (FTIR), Transmission electron microscopy (TEM), and Scanning electron microscope (SEM). The obtained CD-SMIP showed strong fluorescence emission with a symmetric peak at 420 nm using excitation at 340 nm. This synthesized probe was finally applied for the detection of ceftazidime. The fluorescence intensity of CDs-SMIP quenched in presence of ceftazidime molecules. The designed fluorescence probe responded to concentration of ceftazidime over a linear range of 0.18−1.27 μg.L−1 (0.33–2.32 nmol.L−1), also, the limit of detection (LOD) and the relative standard deviation (RSD) were 0.06 μg.L−1 (0.11 nmol.L−1) and 3.20% (n = 5), respectively. The introduced chemical nanosensor was used to analyze ceftazidime in urine samples satisfactory.