Css :: selection tag is not working correctly

I want to use the ::selectionCSS tag on my website, but every time I use it and use it, there are some highlighted parts that behave normally. This happens with spaces and some other things. Do you know why and how I can fix it?

http://jsfiddle.net/o2bbog66/

+4
source share
1 answer

It is worth noting that it ::selectionwas removed from the Selectors Level 3 specification and should be logically avoided while Pseudo-Elements Level 4 is supported by modern browsers. For this reason, you can observe strange problems in browsers that have implemented the Selectors Level 3 pseudo-element version.

7.3. Blank

This section intentionally left blank. (This section previously defined a pseudo-element ::selection.)

The MDN article is::selection further cited:

Although this pseudo-element was in CSS Selectors Level 3 projects, it was removed during the candidate recommendation phase, as it turned out that its behavior was undetermined, especially with nested elements, and interoperability was not achieved.

, , , .

+9

All Articles