CSS Selector ::selection

The ::selection selector selected the user-selected part of an element.

CSS Syntax

::selection {
   style properties 

Browser compatibility

::selection Yes 9.0 Yes Yes Yes


An example showing how to use ::selection CSS selector.

<!DOCTYPE html>
::selection{<!--from  ww w.ja  v  a 2s.  c o m-->

   <p>Drag to select this paragraph.</p>

Click to view the demo