CSS text-emphasis-color Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The text-emphasis-color property sets the color of emphasis marks. It is a longhand of the text-emphasis shorthand and works with text-emphasis-style.

It is inherited. The initial value is currentColor, so marks match the text color until you override them. Color alone draws nothing until a style exists.

Note Style first, then color

Set text-emphasis-style (or the shorthand) before expecting color changes. Without marks, this property has no visible effect.

CSS Syntax

syntax.css
text-emphasis-color: <color> | initial | inherit;

Any valid CSS color works: keywords, hex, rgb(), hsl(), currentColor, transparent, or var(--token).

Property Values

ValueDescriptionTry it
currentColorDefault. Marks use the element text colorTry it
<named-color>Keywords like red or greenTry it
<hex-color>Hex colors such as #2563ebTry it
rgb() / hsl()Functional colors, including alphaTry it
initialResets to currentColorTry it
inheritTakes the parent’s emphasis colorTry it

How to Use text-emphasis-color

Turn marks on with a style, then color them with this longhand.

  1. Set a mark style: text-emphasis-style: filled circle.
  2. Set the mark color: text-emphasis-color: red.
  3. Or combine both: text-emphasis: filled circle red.
  4. Use the longhand when color must cascade separately from style.
PieceRequired?Role
Emphasis styleYes (to see color)Creates the marks to paint
<color>YesPaints those marks
ShorthandOptionaltext-emphasis sets style and color together
PositionOptionalSeparate property; does not affect color

Live Preview

The sample already has filled-circle marks. Change only the mark color.

Style is fixed to filled circle so color changes stay easy to see.

Emphasis color preview
happy than right

text-emphasis-color: red

CSS Examples

Each snippet focuses on text-emphasis-color. A style is included only so the color is visible. Use Try It Yourself for a live editor.

Example 1 — Match the Text Color

Use the default so marks follow the element’s color.

CSS
<style>
  .mark {
    color: #0f172a;
    text-emphasis-style: filled circle;
    text-emphasis-color: currentColor;
  }
</style>

<p class="mark">Matches text color</p>
Try It Yourself

How It Works

  1. Create marks. text-emphasis-style draws the symbols.
  2. Use currentColor. Marks pick up the element text color.
  3. Change text color. Marks update automatically with color.
  4. Default behavior. Leaving the color unset looks the same.

Example 2 — Separate Mark Color

Color the marks differently from the text.

CSS
<style>
  em {
    text-emphasis-style: "*";
    text-emphasis-color: green;
  }
</style>

<em>This has emphasis marks!</em>
Try It Yourself

How It Works

  1. Pick a style. Here a string mark "*" is used.
  2. Set a named color. green paints only the marks.
  3. Text stays separate. The letter color comes from color, not this property.
  4. Longhand clarity. Style and color each get their own declaration.

Example 3 — RGB With Alpha

Use a functional color, including transparency.

CSS
<style>
  .soft {
    text-emphasis-style: filled circle;
    text-emphasis-color: rgb(90 200 160 / 0.8);
  }
</style>

<p class="soft">Soft green marks</p>
Try It Yourself

How It Works

  1. Keep a style. Filled circles make the color easy to see.
  2. Use rgb(). Modern syntax allows space-separated channels and slash alpha.
  3. Soft emphasis. Partial opacity tones the marks down without changing the text.
  4. Theme tip. Swap in var(--accent) the same way for design tokens.

Edge Cases & Pitfalls

If the color seems ignored, one of these is usually why.

style

No style means no color

Without text-emphasis-style (or the shorthand), there are no marks to paint.

shorthand

Shorthand can reset color

A later text-emphasis rule can override a previous text-emphasis-color. Watch cascade order.

current

currentColor follows color

Changing the text color also changes marks when color is currentColor.

transparent

Transparent hides marks

The style is still there, but invisible. Prefer text-emphasis-style: none when you want marks off.

vs text

Does not recolor letters

This property paints marks only. Letter color stays controlled by color.

Browser Support

text-emphasis-color is a browser text-decoration property. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

text-emphasis-color

Interoperable across modern browsers since about March 2022. Internet Explorer does not support this property.

94% Modern browsers
Google Chrome 99+
Full
Mozilla Firefox 46+
Full
Apple Safari 7+
Full
Microsoft Edge 99+
Full
Opera 85+
Full
Samsung Internet 18+
Full
Internet Explorer No
None
text-emphasis-color Widely supported

Bottom line: Safe for modern sites. Support tracks the text-emphasis family. IE has no support.

Key Takeaways

  • Role: color emphasis marks only—not the letters themselves.
  • Initial value: currentColor. Inherited. Needs a style to be visible.
  • Any <color>: keywords, hex, rgb/hsl, transparent, or variables.
  • Shorthand twin: text-emphasis can set style and color in one rule.

One line: text-emphasis-color paints emphasis marks once a style is already set.

Frequently Asked Questions

It sets the color of emphasis marks drawn on characters. Marks only appear when a style is set with text-emphasis-style or the text-emphasis shorthand.
The initial value is currentColor, so marks match the element text color unless you override them.
Yes. Color alone draws nothing. Set a style such as filled circle, then color the marks.
Yes. A parent color can affect child emphasis marks unless a child overrides it or resets the shorthand.
Yes. text-emphasis: filled red sets style and color together. Use the longhand when color needs its own cascade rule.
It is Baseline Widely available (interoperable since about March 2022) in modern browsers. Internet Explorer does not support it. It is a browser rendering property, not a Node.js feature.

Next: text-emphasis-position

Learn where emphasis marks sit relative to the text.

text-emphasis-position tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful