Why can't I combine ::selection and ::-moz-selection in one CSS rule? [duplicate]

落花浮王杯 提交于 2019-12-06 01:17:27

This is from the documentation:

Gecko is the only engine requiring the prefix. Due to the fact that the CSS parsing rules require dropping the whole rule when encountering an invalid pseudo-element, two separate rules must be written: ::-moz-selection, ::selection {...}. The rule would be dropped on non-Gecko browsers as ::-moz-selection is invalid on them.

https://developer.mozilla.org/en-US/docs/Web/CSS/::selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!