I\'ve created a select
list with options having :after
and :before
pseudo-elements - DEMO
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
.