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>
            ::selection {
                color: #ff0000;
            }::-moz-selection {
                color: #ff0000;
        <h1>Try to select some text on this page</h1>
            This is a paragraph.
            This is some text in a div element.
        <a href="" target="_blank">Ayunor Learning</a>