The authors have carried out systematic first-principles calculations to elucidate the effect of a nonmetal atom (B, C, N, P, As, O, or F) substitutional doping at S site on the structural, electronic, and magnetic properties of single-layer CrS2 with H phase. The lower formation energy under Cr-rich condition shows that these doped systems are easy to be realized in experiment. The single-layer CrS2 is nonmagnetic semiconductor with a direct band gap of 0.93 eV. The numerical results suggest that the nonmetal atoms can effectively modulate the electronic and magnetic properties of single-layer CrS2. C- or O-doped system is still nonmagnetic semiconductor but the band gap is changed slightly. B-, N-, P-, As-, or F-doped system is magnetic compound with total magnetic moments of 1 mu(B) due to the introduced one extra hole or electron. It is worth mentioning that the P-doped system is half-metal and As-doped system is a spin-gapless semiconductor. Nonmetal atom doping at anion site is indeed an effective method to tune the electronic and magnetic properties of single-layer CrS2, which have promising applications in spintronics and nanoelectronics.