google-chrome - Ugly::selection 双色背景

标签 google-chrome css selection

我试图在 Chrome 中使用自定义 ::selection 效果,但在突出显示的文本上出现这种糟糕的蓝色:

enter image description here

这是我的 CSS:

::selection {
    color:#ffffff; 
    background: #000000;
}
::-moz-selection {
    color:#ffffff; 
    background: #000000;
}
::-webkit-selection {
    color:#ffffff;
    background: #000000;
}

我无法在 Firefox 中重现该错误 - 有什么我可以做的,还是它只是浏览器的一项功能?

最佳答案

您想将文本包装在 <p> 中标签。

关于google-chrome - Ugly::selection 双色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6398166/

相关文章:

google-chrome - CSS3 灵活框布局(最新)最大高度

css - Sidenav Z-Index 窗口变暗

javascript - 如何使用 jQuery 选择 <pre> 中包含的所有文本?

android - Android EditText 的 getSelectionEnd() getSelectionStart() 不返回正确的值

css - Google Chrome 显示 Google WebFont 错误

Chrome 中的 HTML 显示了 IE 中未显示的附加边框

html - Bootstrap 内联表单元素

javascript - 取决于媒体查询的通用参数

安卓 ListView : How to skip a row when scrolling listview

javascript - Chrome : Page action not working