Check out example codes for "custom selection color css". It will help you in understanding the concepts better.

Code Example 1

::selection {
	color: #000000;
	background-color: red;
}

/* for firefox */
::moz-selection {
	color: #000000;
	background-color: red;
}

Learn ReactJs, React Native from akashmittal.com