<div>
<h1>selection pseudo-element.</h1>
<p>This pseudo-element simply targets highlighted contents on the webpage and you can easily add styles to it.</p>
</div>
::selection {
color: red;
background: black;
}
div > p::selection {
color: blue;
backgroung: grey;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.