::marker - CSS Selector
Summary of characteristics of the ::marker selector
Description of the ::marker pseudo-element.
The pseudo-element ::marker is a selector that targets the bullets or numbers in a list (li tags).
Only the bullets or numbers are affected: this selector does not target the text that follows.
::marker also targets the small triangles in a details element. These components are used to reveal their content on demand
by the user. The full text of the details component is displayed by clicking on this triangle.
Show more (click the triangle).
Full text, which can be shownor hidden on the user's request.
The only properties you can use with the selector ::marker are the following:
- The
colorproperty. - The
contentproperty. - The font properties (their name starts with
font-...). - The
white-spaceproperty. - The properties
text-combine-upright,unicode-bidianddirection. - Animation and transition properties.
Examples of use of pseudo-élément ::marker.
Applying ::marker to bulleted or numbered lists.
The examples below show three uses of ::marker:
- Number formatting.
- Using an image.
- Using a text.
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
Applying ::marker to a details component.
Note: The pseudo-element ::marker allows you to change the appearance of the triangle by replacing it with another character, but then
you lose the ability to automatically toggle it on mouse click. So you have to handle that yourself. This is the case in the example below where
the :open pseudo-class was used to detect if the component is open, and a different character was applied.
Component details title.
Component text, revealed onrequest.
The animations applied to ::marker.
Animations and transitions can be applied to the pseudo-elements ::marker, but it doesn't work in all browsers.
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
Browser compatibility with ::marker.
The pseudo-element ::marker is fairly well supported by browsers, but its nesting with ::before or ::after is trickier.
Check out the compatibility table below.
::marker.::marker with ::after and ::before.Notes:
(1) Safari support is limited to color and font size.
::markerpseudo-element
::marker::before and ::afterBrowsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Samsung Internet

Firefox

Firefox pour Androïd

Chrome

Edge

Safari

Opéra

Safari sur IOS

Androïd Brower

Chrome pour Androïd

KaiOS Browser

Opéra mini
Historic of the ::marker pseudo-element.
-
CSS Pseudo-Elements Module Level 4
Regarding::markerIntroduction of the::markerpseudo-element.January 15, 2015Working Draft.
See also (other pseudo-elements).
Many pseudo-elements exist in CSS. They are grouped in the specification CSS Pseudo-Elements Module . Here are a few of them, which target a part of the page, or a part of an element.




