offline version v3


106 of 298 menu

selection pseudo-element

The selection pseudo-element allows you to set a color and background of a selected text.

Syntax

selector::selection { }

Example

Select the text and you will see that it will be red on a black background:

<div id="elem"> Lorem ipsum dolor sit amet. </div> #elem::selection { color: red; background-color: black; }

:

See also

enru