I am currently working on a website where I want to customize the text selection color.
::selection {
background-color:#00ffff;
}
However, there seems to be an issue in this specific situation:
p::after {
content:"Try selecting the above elements. The underline does not remain preserved, but the italic formatting is maintained."
}
::selection {
background-color:#00ffff;
text-decoration:auto;
}
<u>Select me!</u>
<i>Select me!</i>
<p></p>
So, how can I ensure that the underlined text remains preserved when selected?
Update:
I am using Chrome 92.0.4479.3 (canary build) on Microsoft Windows 10 Home.
Screenshot: