Why the :before and :after pseudo-elements work only in Firefox?

前端 未结 2 992
臣服心动
臣服心动 2020-12-21 05:56

I\'ve created a select list with options having :after and :before pseudo-elements - DEMO



        
相关标签:
2条回答
  • 2020-12-21 06:35

    Whether there is a restriction is undefined, hence the inconsistent behavior. This is mentioned at the bottom of the relevant section in the spec:

    Note. This specification does not fully define the interaction of :before and :after with replaced elements (such as IMG in HTML). This will be defined in more detail in a future specification.

    Most HTML form elements are considered replaced elements, including select and option.

    0 讨论(0)
  • 2020-12-21 06:50

    Have you read this: :before and :after pseudo elements on html tag is wonky in Chrome ?

    The accepted answer said that is an issue in Chrome:

    https://code.google.com/p/chromium/issues/detail?id=75544

    0 讨论(0)
提交回复
热议问题