::selection { background: #000000; opacity: 0 }
::-moz-selection { background: #000000; opacity: 0 }
I am struggling with setting the color of selected text on my website to be pure black, however, since my text is already black, it gets hidden by the selection. Is there a way to change the text color to white when it is selected so that unselected text remains black on the white background, while selected text appears as white on a black selection? Any help would be appreciated. Thank you!