coderef

ruby-positionBaseline · Newly available

The ruby-position CSS property sets the position of a ruby annotation in relation to its base text. Annotations can display over, under, or interleaved with the base text.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Dec 11, 2024.

Browser support

DesktopChrome
1–83Not supported
84+Supportedsince Jul 27, 2020
Current: 155
Edge
12–83Not supported
84+Supportedsince Jul 16, 2020
Current: 154
Firefox
1–37Not supported
38+Supportedsince May 12, 2015
Current: 157
Safari
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27
MobileChrome Android
18–83Not supported
84+Supportedsince Jul 27, 2020
Current: 155
Firefox Android
4–37Not supported
38+Supportedsince May 12, 2015
Current: 157
Safari iOS
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Dec 11, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: ruby-position.

Feature detection

CSS · check before using
@supports (ruby-position: initial) {
  /* styles that rely on ruby-position */
}

/* or in JavaScript */
if (CSS.supports("ruby-position", "initial")) {
  // use it
}

Documentation (MDN)

Specification

Sub-features

Support for each part of the feature (4). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
ruby-position84843818.2843818.2
ruby-position.inter-character✕✕✕✕✕✕✕
ruby-position.over84843818.2843818.2
ruby-position.under84843818.2843818.2