Thus, the stylist made the selection through the pseudo-element :: selection in order to override the default selection color for the browser. But for me it seems that the white color of the highlight is forbidden in favor of a grayish, opaque color.
::selection { color: black; background: white; }
::-moz-selection { color: black; background: white; }
body {
background: black;
color: white;
}
So selecting me is supposed to invert the text and background colors. But the selected text background color is not white, but grey.
Run codeHide resultWhy doesn't this create a completely white background? Instead, it shows a gray background (# 989898)

Also see this snippet at https://jsfiddle.net/duk3/hzodm1sh/
source
share