This quick how-to reference provides the CSS code to change selection color on a website. The above image illustrates selection of text from the AS3rd homepage.
So, we can actually change the style of selected information on a website.
Code to change selection color on a website
Below is CSS code to set the selection color for a website.
::-moz-selection { /* Code for Firefox */
color: #fff !important;
background: #67993a !important;
}
::selection {
color: #fff !important;
background: #67993a !important;
}
Overall, you may not need the !important property. Since we had some issues with the old selection color, we wanted to emphasize importance to this instruction.
Although we focus on text color and background color, you should be able to include additional styling features. We keep it simple in this instruction.
YouTube LinkedIn