css change text color when <a> selected code example
Example 1: custom selection color css
::selection {
color: #000000;
background-color: red;
}
/* for firefox */
::moz-selection {
color: #000000;
background-color: red;
}
Example 2: change highlight color html
::-moz-selection { /* Code for Firefox */
color: red;
background: yellow;
}
::selection {
color: red;
background: yellow;
}