这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

ruby-align CSS property defines the distribution of the different ruby elements over the base.

/* Keyword values */
ruby-align: start;
ruby-align: center;
ruby-align: space-between;
ruby-align: space-around;
/* Global values */
ruby-align: inherit;
ruby-align: initial;
ruby-align: unset;
					

句法

start

Is a keyword indicating that the ruby will be aligned with the start of the base text.

center

Is a keyword indicating that the ruby will be aligned at the middle of the base text.

space-between

Is a keyword indicating that the extra space will be distributed between the elements of the ruby.

space-around

Is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it.

形式定义

初始值 space-around
适用于 ruby bases, ruby annotations, ruby base containers, ruby annotation containers
继承 yes
计算值 如指定
动画类型 discrete

形式句法

start | center | space-between | space-around
					

范例

Ruby aligned at the start of the base text

HTML

<ruby>
  <rb>This is a long text to check</rb>
  <rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
  ruby-align: start;
}
					

结果

Ruby aligned at the center of the base text

HTML

<ruby>
  <rb>This is a long text to check</rb>
  <rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
  ruby-align: center;
}
					

结果

Extra space distributed between ruby elements

HTML

<ruby>
  <rb>This is a long text to check</rb>
  <rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
  ruby-align: space-between;
}
					

结果

Extra space distributed between and around ruby elements

HTML

<ruby>
  <rb>This is a long text to check</rb>
  <rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
  ruby-align: space-around;
}
					

结果

规范

规范 状态 注释
CSS Ruby Layout Module Level 1
The definition of 'ruby-align' in that specification.
工作草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
ruby-align Experimental Chrome 不支持 No Edge 不支持 No Firefox 完整支持 38 IE 不支持 No 注意事项
不支持 No 注意事项
注意事项 Internet Explorer 9 and later supports an earlier draft of CSS Ruby with non-standard values for this property: auto , left , center , right , distribute-letter , distribute-space ,和 line-edge .
Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 38 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

见实现注意事项。

另请参阅

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考
  3. CSS Ruby
  4. 特性
    1. ruby-align
    2. ruby-position