The detection of acid in different solution environments plays a significant role in chemical, environmental and biological fields. However, reducing the constraints of detecting environment, such as aqueous, organic solvents and mixed phases of aqueous and organic phases, remains a challenge. Herein, by combining N, N, N′, N′-tetrakis(4-aminophenyl)-1,4-phenylenediamine (TPBD) and terephthalaldehyde (TA) via Shiff-base condensation, we constructed a covalent organic framework (COF) TPBD-TA COF. The COF exhibits color change from red to dark red as well as fluorescence quenching with the increase of acid contents in either aqueous or organic solvents, or a mixture of aqueous and organic solvents, due to the weak donor-acceptor interactions within the COF as well as the weak proton ionization ability of the solutions. Therefore, regardless of the detection environment, TPBD-TA COF can realize color and fluorescence dual-response to acid with the detection limit as low as 0.4 μmol/L and 58 nmol/L, respectively, due to the protonation of the nitrogen atoms on imine bonds of the COF.