CSS Selector ::selection

Description

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

Example


<!DOCTYPE html>
<html>
<head>
<style>
::selection{<!--   w w w.  j  av a2 s. com-->
   color:#ff0000;
}

</style>
</head>
<body>
   <p>Drag to select this paragraph.</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

::selection




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference