Selection

Syntax

Class
Properties
{...}selection:{...}
{...}::selection{...}
<div class="t1 selection:bg-c-red selection:color-white"> Try selecting this text! </div>

Specification test cases

The test cases below are imported from the Turbo CSS specification. They have been executed upon loading this page.
Set the background color of highlighted text to purple.
t1 selection:bg-c-hex-C070F0
.t1.selection\:bg-c-hex-C070F0::selection { background-color: #C070F0; }