Check out example codes for "how to change highlight color on website". It will help you in understanding the concepts better.

Code Example 1

/* Change Selection Text Color When Highlighting */ 

::-moz-selection { background-color: #476f30; 
color: #fff; } 
::selection { background-color: #476f30; 
color: #fff; }

Learn ReactJs, React Native from akashmittal.com