In this short tutorial we are going to see, how to override the default text selection color with CSS. Text is said to be selected when, user clicks and drag the mouse across text. If you click and drag this text, browser will automatically add background color to it - in my case it is light blue as we can see in image below.
Lets see how we can, change the default section color of blue to light green.
You can change the background color, color and text shadow of selected text by styling
::selection pseudo selector.
Now, when you try to click and drag text inside the blue box above, its going to be highlighted with light green background.
Hope you enjoyed this tutorial!