Changing CSS text selection colour (with classes)

The code works, however, by ‘‘selection color’’ I meant the blue boxes behind letters when one would select text in, for example, in Wikipedia. In this site, it is set to green. In CSS it is, appearantly, usually modifed like this:

::selection {
  color: red;
}

If I would want to change this parameter just like the background colors, would I need to approach it the same way?