Home > Net >  CSS ::marker pseudo-element why only couple of CSS properties work? why not all?
CSS ::marker pseudo-element why only couple of CSS properties work? why not all?

Time:01-06

why ::marker pseudo-element not support all CSS properties like other pseudo-elements? can anyone explain me in brief.

Found out today that ::marker pseudo-element not support all CSS properties like background, display, etc but "font-size", "color", and "content" properties are working like charm.

CodePudding user response:

The CSS Lists specification explains:

NOTE: It is expected that future specifications will extend this list of properties and relax the restriction on which properties can take effect. However at the moment outside marker box layout is not fully defined, so to avoid future compatibility problems only these properties are allowed.

CodePudding user response:

Because this selector selects marker of a list item. Like the buller for example. That means that it allows you only to customize the bullet, not the list itself. Thats why you cant apply properties like display, because you are effecting the marker itself. This can be helpful

  • Related