EN
CSS - how to change text selection color
0
points
In this article, we would like to show you how to change text selection color using CSS.
Quick solution:
::selection {
color: red;
background: yellow;
}
Practical example
In this section, we present a practical example of how to change text selection color.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
::selection {
color: red;
background: yellow;
}
</style>
</head>
<body>
<p> some text... </p>
</body>
</html>