Green, blue and pink fluorescent carbon dots (o/m/p-CDs) were prepared by one-step hydrothermal method with three isomers (o/m/p) of phenylenediamine as nitrogen and carbon sources and ethanol as solvent. The obtained carbon dots exhibited different luminescence behaviors, and the luminescence behaviors were affected by solvent and pH. More interestingly, m-CDs exhibited obvious discoloration behavior under different pH conditions and had excellent linear relationship under acidic and basic conditions, respectively. Furthermore, we combined m-CDs with test paper, PVA film, and cotton fabric, respectively, to prepare composites for visual pH detection. The as-prepared composite material has excellent visual detection effect for a small amount of test sample (<5 μL) in the fine pH range (0.5 unit), and could be applied to trace pH detection.