【发布时间】:2021-07-01 13:49:20
【问题描述】:
我正在制作一个带有自定义选择颜色的网页。
::selection {
background-color:#00ffff;
}
但是看看这个场景:
p::after {
content:"Try selecting the above elements. The underline is not preserved, but the italic is preserved."
}
::selection {
background-color:#00ffff;
text-decoration:auto;
}
<u>Select me!</u>
<i>Select me!</i>
<p></p>
那么,如何让选中的文本中保留下划线呢?
Update:
I'm using Chrome 92.0.4479.3 (canary build) on Microsoft Windows 10 Home.
Screenshot:
【问题讨论】:
-
我不明白这个问题,下划线保留在您发布的sn-p中。