Herein, we report for the first time the use of bipyridine-based hydrogel for selective and visible detection and absorption of Cd(2+). At low concentrations, hydrogelator 1 was applied for selective detection of Cd(2+) in vitro and in living cells with high sensitivity. In the absence of metal ions, 1 is nonfluorescent at 470 nm. Upon addition of metal ions, 1 selectively coordinates to Cd(2+), causing an 86-fold increase of fluorescence intensity at 470 nm via the chelation enhanced fluorescence (CHEF) effect, as revealed by first-principles simulations. At 1.5 wt% and pH 5.5, 1 self-assembles into nanofibers to form hydrogel Gel I. Since Cd(2+) could actively participate in the hydrogelation and promote the self-assembly, we also successfully applied Gel I for visible detection and absorption of Cd(2+). With these excellent properties, Gel I is expected to be explored as one type of versatile biomaterial for not only environmental monitoring but also for pollution treatment in the near future.