selection(::selection)

The ::selection CSS pseudo-element applies rules to the portion of a document that has been highlighted (e.g., selected with the mouse or another pointing device) by the user.
 
Only a small subset of CSS properties can be used in a rule using ::selection in its selector: color, background, background-color and text-shadow. Note that, in particular, background-image is ignored, like any other property.

<!DOCTYPE html>
<html>
    <head>
        <style>
            ::selection {
                color: #ff0000;
            }::-moz-selection {
                color: #ff0000;
            }
        </style>
    </head>
    <body>
        <h1>Try to select some text on this page</h1>
        <p>
            This is a paragraph.
        </p>
        <div>
            This is some text in a div element.
        </div>
        <a href="http://www.loopandbreak.com" target="_blank">Ayunor Learning</a>
    </body>
</html>