【发布时间】:2015-09-28 10:26:13
【问题描述】:
所以文本选择通过 ::selection 伪元素进行样式化,以覆盖浏览器的默认选择颜色。但对我来说,白色作为选择背景颜色似乎是被禁止的,而是采用灰色、不透明的颜色。
::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.
为什么这不创建一个完美的白色背景?相反,它显示灰色背景 (#989898)
在https://jsfiddle.net/duk3/hzodm1sh/上也可以看到这个sn-p
【问题讨论】:
-
你在什么浏览器上得到这个结果?
-
这发生在 Chrome 和 Safari 中 - 当前版本仍然存在
标签: css webkit selection styling