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

ruby-position CSS property defines the position of a ruby element relatives to its base element. It can be position over the element ( over ), under it ( under ), or between the characters, on their right side ( inter-character ).

/* Keyword values */
ruby-position: over;
ruby-position: under;
ruby-position: inter-character;
/* Global values */
ruby-position: inherit;
ruby-position: initial;
ruby-position: unset;
					

句法

over
Over example Is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts.
under
Under example Is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts.
inter-character

Is a keyword indicating that the ruby has to be placed between the different characters.

形式定义

初始值 over
适用于 ruby annotations containers
继承 yes
计算值 如指定
动画类型 discrete

形式句法

over | under | inter-character
					

范例

Ruby positioned over the text

HTML

<ruby>
  <rb>超電磁砲</rb>
  <rp>(</rp><rt>レールガン</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
    ruby-position:over;
}
					

结果

Ruby positioned under the text

HTML

<ruby>
  <rb>超電磁砲</rb>
  <rp>(</rp><rt>レールガン</rt><rp>)</rp>
</ruby>
					

CSS

ruby {
    ruby-position:under;
}
					

结果

规范

规范 状态 注释
CSS Ruby Layout Module Level 1
The definition of 'ruby-position' 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-position Experimental Chrome 不支持 No Edge 不支持 12 — 79 Firefox 完整支持 38 IE 不支持 No 注意事项
不支持 No 注意事项
注意事项 Internet Explorer 9 and later support an old draft values: inline (equivalent of having display: inline on the ruby), and above (synonym of the modern over ).
Opera 不支持 No Safari 不支持 No 注意事项
不支持 No 注意事项
注意事项 Safari implements a non-standard, prefixed, version of ruby-position , -webkit-ruby-position : it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start ).
WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 38 Opera Android 不支持 No Safari iOS 不支持 No 注意事项
不支持 No 注意事项
注意事项 Safari implements a non-standard, prefixed, version of ruby-position , -webkit-ruby-position : it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start ).
Samsung Internet Android 不支持 No
inter-character Experimental Chrome 不支持 No Edge 不支持 No Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 No Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

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

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

见实现注意事项。

见实现注意事项。

另请参阅

元数据

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

Copyright  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1