gpt4 book ai didi

css -::selection 不适用于具有::first-letter 的文本

转载 作者:行者123 更新时间:2023-11-28 11:58:08 25 4
gpt4 key购买 nike

::selection 不适用于包含 ::first-letter 的文本。这是代码:

p::first-letter {
font-size: 130%;
}

::selection {
background: red;
color: white;
}
<p>hello</p>

Live demo

当您选择时,它不会将颜色应用到 h

enter image description here

我尝试添加 !important,但仍然不起作用。

::selection {
background: red !important;
color: white !important;
}

最佳答案

我记得很久以前遇到过这个..

这是 chrome 中的一个已知错误,似乎仍然是个问题!

https://bugs.chromium.org/p/chromium/issues/detail?id=17528

关于css -::selection 不适用于具有::first-letter 的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49683933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com