Webkit CSS - 用于更改突出显示颜色的选择器

发布于 2024-12-27 02:03:04 字数 310 浏览 5 评论 0原文

我注意到 Chrome 中的效果很酷 此网站,它可能是或不是 Chrome 独有的,但可能适用于所有 Webkit 浏览器。

当用户拖动以突出显示某些内容时,他们会将默认颜色更改为粉红色。

你能识别选择器吗?

我想看看是否有人知道描述此类效果的参考页。

I noticed a cool effect in Chrome at this site, which may or may not be unique to Chrome but possibly for all Webkit browsers.

When the user drags to highlight something, they've changed the default color to pink.

Can you identify the selector?

I would like to see if someone knows of a reference page which describes these kinds of effects.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

呆橘 2025-01-03 02:03:04

使用

::-moz-selection,
::selection{
    background: #fe57a1;
    color: #fff;
    text-shadow: none;
}

HTML5 BoilerPlate

use

::-moz-selection,
::selection{
    background: #fe57a1;
    color: #fff;
    text-shadow: none;
}

from HTML5 BoilerPlate

寄离 2025-01-03 02:03:04

我在该页面中找到了此 CSS:

::selection {
  background: #E02F86;
  color: white;
}

另外,在此处尝试过。

I found this CSS in that page:

::selection {
  background: #E02F86;
  color: white;
}

Also, tried it here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文