coderef

ruby-alignBaseline · Newly available

The ruby-align CSS property sets the spacing and alignment of ruby annotation text when it does not fill its available space.

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–127Not supported
128+Supportedsince Aug 20, 2024
Current: 155
Edge
12–127Not supported
128+Supportedsince Aug 22, 2024
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–127Not supported
128+Supportedsince Aug 20, 2024
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-align.

Feature detection

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

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

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
ruby-align1281283818.21283818.2
ruby-align.center1281283818.21283818.2
ruby-align.space-around1281283818.21283818.2
ruby-align.space-between1281283818.21283818.2
ruby-align.start1281283818.21283818.2