CSS text-emphasis-position Property

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

Definition and Usage

The text-emphasis-position property sets where emphasis marks are drawn—over or under the text in horizontal writing, and left or right in vertical writing. Like ruby, marks can increase line height when space is tight.

It is inherited. The initial value is auto. It is not part of the text-emphasis shorthand, so style and color can change without resetting position.

Note Not reset by text-emphasis

The shorthand never sets position. Use this property when placement must change. Preferred positions often differ by language (e.g. Japanese over, Chinese under).

CSS Syntax

syntax.css
text-emphasis-position: auto | over | under | [ over | under ] [ right | left ] | initial | inherit;

One value: auto, over, or under (missing side defaults to right). Two values: one of over/under plus one of right/left (order does not matter).

Property Values

ValueDescriptionTry it
autoDefault. Over in horizontal; right in verticalTry it
overMarks above the text (horizontal writing)Try it
under / under rightMarks below the text (horizontal writing)Try it
over left + verticalSide placement in writing-mode: vertical-rlTry it
initialResets to autoTry it
inheritTakes the parent’s positionTry it

How to Use text-emphasis-position

Create marks first, then choose where they sit for your writing mode and language.

  1. Set a style (and optional color): text-emphasis: filled circle red.
  2. For horizontal text, pick over or under.
  3. For vertical text, include right or left (or rely on auto).
  4. Match language norms when possible (e.g. Chinese often uses under).
PieceRequired?Role
Emphasis styleYes (to see position)Creates the marks to place
Position keyword(s)Yesauto, over/under, and optional left/right
Writing modeContextControls which keyword pair is visible
ShorthandNotext-emphasis never sets this property

Live Preview

Marks stay filled circle. Change only where they sit. Switch to vertical mode to see left/right matter more.

over/under matter most horizontally. left/right matter most in vertical writing.

Emphasis position preview
happy than right

text-emphasis-position: over

CSS Examples

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

Example 1 — Marks Above

Place marks over horizontal text (common for Japanese).

CSS
<style>
  .mark {
    text-emphasis: filled circle #dc2626;
    text-emphasis-position: over;
  }
</style>

<p class="mark">重要ポイント</p>
Try It Yourself

How It Works

  1. Create marks. The shorthand sets style and color.
  2. Set over. Marks sit above each character.
  3. Side defaults. Without left/right, browsers assume right.
  4. Not in shorthand. Position stays set even if you change text-emphasis later.

Example 2 — Marks Below

Place marks under horizontal text (common for Chinese).

CSS
<style>
  .mark {
    text-emphasis: filled circle #dc2626;
    text-emphasis-position: under right;
  }
</style>

<p class="mark">重点内容</p>
Try It Yourself

How It Works

  1. Use two keywords. under for horizontal; right for vertical.
  2. Order free. right under means the same pairing.
  3. Language tip. under is often preferred for Chinese horizontal text.
  4. Line height. Under marks may also grow the line box when space is tight.

Example 3 — Vertical Writing Mode

In vertical text, left and right control which side gets the marks.

CSS
<style>
  .vert {
    writing-mode: vertical-rl;
    text-emphasis: filled circle #dc2626;
    text-emphasis-position: over left;
  }
</style>

<p class="vert">縦書き</p>
Try It Yourself

How It Works

  1. Set writing mode. writing-mode: vertical-rl stacks the text.
  2. Add marks. Style/color still come from text-emphasis.
  3. Pick a side. left moves marks to the left of each glyph.
  4. Keep over. The pair stays valid for mixed horizontal/vertical layouts.

Edge Cases & Pitfalls

If marks do not move where you expect, check these first.

style

No style means no position

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

shorthand

Shorthand never resets position

Changing text-emphasis leaves this property alone. That is intentional so language position can stay stable.

mode

Writing mode changes which keyword wins visually

In horizontal text, focus on over/under. In vertical text, focus on left/right.

height

Marks can grow line height

If leading is tight, browsers expand the line so marks fit—similar to ruby.

lang

Prefer positions by language

Japanese often uses over; Chinese often uses under. Match reader expectations when you can.

Browser Support

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

✓ Baseline · Widely available

text-emphasis-position

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-position Widely supported

Bottom line: Safe for modern sites. Support tracks the text-emphasis family. The auto keyword is newer than over/under; IE has no support.

Key Takeaways

  • Role: place emphasis marks over/under or left/right of characters.
  • Initial value: auto. Inherited. Not part of text-emphasis.
  • Keywords: over/under for horizontal; left/right for vertical.
  • Language tip: Japanese often over; Chinese often under.

One line: text-emphasis-position decides which side of the glyph gets the emphasis mark.

Frequently Asked Questions

It sets where emphasis marks are drawn relative to characters: over or under in horizontal writing, and left or right in vertical writing.
The initial value is auto. That draws marks over the text in horizontal writing mode and to the right in vertical writing mode.
No. The text-emphasis shorthand does not set or reset position. Change placement with this longhand only.
Yes. Marks appear only when text-emphasis-style or the shorthand creates them. Position then controls placement.
Japanese often prefers over (horizontal) and right (vertical). Chinese often prefers under (horizontal) and right (vertical).
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-style

Learn the longhand that chooses the mark shape or string.

text-emphasis-style 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