The ::marker pseudo-element targets list bullets and numbers. Style markers without touching the list item text or adding extra HTML.
01
Bullets
ul markers.
02
Numbers
ol markers.
03
content
Custom glyph.
04
color
Tint markers.
05
Limited
Few properties.
06
vs ::before
Know when.
Fundamentals
Introduction
The ::marker pseudo-element in CSS is used to target and style the marker of list items. This includes bullets in unordered lists (<ul>) and numbers or letters in ordered lists (<ol>).
By using ::marker, you can customize list markers beyond their default styling, giving you more control over list design on your web pages.
Definition and Usage
Write li::marker or ul li::marker to style the automatically generated bullet or number. The marker is separate from the list item’s text content.
💡
Beginner Tip
::marker only supports a small set of CSS properties. If you need backgrounds, borders, or complex layouts on bullets, use ::before with list-style: none instead.
Foundation
📝 Syntax
The syntax for the ::marker pseudo-element is:
syntax.css
::marker{/* CSS properties */}
The ::marker pseudo-element applies to <li> elements inside <ul> and <ol> lists, as well as <summary> elements.
Basic Example
marker-basic.css
ul li::marker{color:#b91c1c;font-size:1.15em;content:"→ ";}
li::markerul li::markerol li::marker
Allowed Properties
Property
Supported on ::marker
color
Yes
font-size, font-family
Yes
content
Yes (replaces default bullet/number)
background, border
No
box-shadow, padding
No
Syntax Rules
Use double colon ::marker for pseudo-elements (modern syntax).
Only a limited set of properties applies to markers.
content replaces the default bullet or number glyph.
Works on li in both ul and ol lists.
For heavy customization, fall back to ::before on li.
Related Selectors
::before — alternative for fully custom list bullets
list-style-type property — changes bullet shape without ::marker
:first-child / :last-child — style list items by position
counter() in content — custom numbered markers on ordered lists
Cheat Sheet
⚡ Quick Reference
Question
Answer
Selector type
Pseudo-element
Syntax
li::marker
Targets
List bullets and numbers
Key properties
color, font-size, content
Common use
Colored arrows, custom bullets, styled numbers
Browser support
All modern browsers (not IE)
Context
When to Use ::marker
::marker is ideal for list presentation tweaks:
Brand-colored bullets — Match list markers to your site palette.
Arrow or icon bullets — Replace discs with content: "→ ".
Styled numbers — Bold or colorize ordered list counters.
Readable docs — Increase marker size without enlarging list text.
Quick wins — Simpler than rebuilding lists with ::before.
Preview
👀 Live Preview
Red arrow markers styled with ul li::marker:
First item
Second item
Third item
Hands-On
Examples Gallery
Practice ::marker with unordered lists, ordered lists, color sizing, and comparison with ::before.
📜 Core Patterns
Customize bullets and numbers on list items.
Example 1 — Arrow bullets on unordered list
Replace default discs with red arrows using content on ::marker.
Without changing content, the browser keeps the default disc shape. Only the marker’s color and size change.
Example 4 — When ::before is the better choice
For background circles or complex bullets, use ::before with list-style: none.
marker-vs-before.css
/* ::marker — limited to text properties */li::marker{color:#2563eb;}/* ::before — full styling when marker is not enough */ul.custom li{list-style:none;position:relative;padding-left:1.5rem;}ul.custom li::before{content:"";position:absolute;left:0;width:0.5rem;height:0.5rem;background:#2563eb;border-radius:50%;top:0.55em;}
::marker cannot set background or border-radius. For filled circle bullets, hide the default marker and build one with ::before.
Tips
💬 Usage Tips
Limited properties — Stick to color, font-size, font-family, and content on ::marker.
content replacement — Use content to swap bullets for arrows, emojis, or symbols.
Ordered lists — Combine counter(list-item) with custom brackets or prefixes.
Readability — Increase font-size on markers to make lists easier to scan.
Heavy customization — Reach for ::before when you need backgrounds or shapes.
Watch Out
⚠️ Common Pitfalls
Unsupported properties — Background, border, padding, and box-shadow do not work on ::marker.
Internet Explorer — IE does not support ::marker; provide a ::before fallback.
list-style: none — Removing list markers disables ::marker; the pseudo-element has nothing to style.
Overriding content carelessly — Changing content on ol may break expected numbering unless you use counters.
Accessibility — Keep semantic <ul>/<ol>; decorative markers should not replace list structure.
A11y
♿ Accessibility
Preserve list semantics — Use real <ul> and <ol> elements; screen readers rely on them.
Do not remove markers silently — If you hide bullets with list-style: none, ensure content is still navigable.
Color contrast — Marker colors should be distinguishable from the background.
Meaningful order — On ordered lists, keep logical sequence when customizing numbers.
🧠 How ::marker Works
1
Browser creates marker
For each <li>, the browser generates a bullet or number marker box.
Generate
2
::marker targets it
CSS rules on li::marker apply only to that marker box, not the text.
Target
3
Limited styles apply
Only permitted properties like color, font-size, and content affect the marker.
Style
=
•
Styled lists
Bullets and numbers match your design without extra HTML.
Compatibility
🖥 Browser Compatibility
::marker is supported in all modern browsers. Internet Explorer does not support it.
✓ Baseline · Modern browsers
List marker styling today
::marker works in Chrome, Firefox, Safari, and Edge. Use ::before for IE fallbacks.
96%Modern support
Google Chrome86+ · Desktop & Mobile
Full support
Mozilla Firefox68+ · Desktop & Mobile
Full support
Apple Safari11.1+ · macOS & iOS
Full support
Microsoft Edge86+ (Chromium)
Full support
Internet ExplorerNot supported
Use ::before fallback
::marker pseudo-element96% supported
Bottom line:::marker is safe for modern projects; use ::before bullets only when IE support is required.
Wrap Up
🎉 Conclusion
The ::marker selector gives you control over list bullets and numbers, helping align list styles with your overall page design.
While limited in which properties it accepts, it provides a simple way to customize lists without affecting content. For advanced bullet shapes, combine with ::before when needed.
Use ::marker for color and content tweaks on lists
Keep semantic ul/ol markup
Use counter(list-item) for custom ol formats
Fall back to ::before for complex bullets
Test ordered list numbering after content changes
❌ Don’t
Apply background or border to ::marker
Set list-style: none and expect ::marker to work
Replace lists with divs just for styling
Assume IE supports ::marker
Override ol content without a counter plan
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ::marker
Use these points when styling list markers.
5
Core concepts
•01
List markers
Bullets & nums.
Purpose
::02
li::marker
Syntax.
Pattern
303
content
Custom glyph.
Property
!04
Limited
Few props.
Rule
🌐05
96% support
Not IE.
Compat
❓ Frequently Asked Questions
The ::marker pseudo-element targets the bullet or number displayed before a list item in ul and ol lists. It lets you style markers without changing the list item text.
::marker applies to li elements inside ul or ol lists, and also summary elements. The list item must have a visible marker generated by the browser.
Only a limited set: mainly color, font-size, font-family, content, white-space, and a few font-related properties. Background, border, and box-shadow are not supported on ::marker.
::marker styles the browser-generated list bullet or number. ::before inserts custom content before the li text and supports more properties, but requires list-style: none and manual layout.
All modern browsers support ::marker. Internet Explorer does not. For legacy support, use ::before on li elements as a fallback.