ruby-align
Baseline
2024
Newly available
Since December 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
ÐкÑпеÑименÑалÑÐ½Ð°Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑ: ÐÑо ÑкÑпеÑименÑалÑÐ½Ð°Ñ ÑеÑ
нологиÑ
Так как ÑпеÑиÑикаÑÐ¸Ñ ÑÑой ÑеÑ
нологии еÑÑ Ð½Ðµ ÑÑабилизиÑовалаÑÑ, ÑмоÑÑиÑе ÑаблиÑÑ ÑовмеÑÑимоÑÑи по Ð¿Ð¾Ð²Ð¾Ð´Ñ Ð¸ÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² ÑазлиÑнÑÑ
бÑаÑзеÑаÑ
. Также замеÑÑÑе, ÑÑо ÑинÑакÑÐ¸Ñ Ð¸ поведение ÑкÑпеÑименÑалÑной ÑеÑ
нологии Ð¼Ð¾Ð¶ÐµÑ Ð¸Ð·Ð¼ÐµÐ½Ð¸ÑÑÑÑ Ð² бÑдÑÑиÑ
веÑÑиÑÑ
бÑаÑзеÑов, вÑлед за изменениÑми ÑпеÑиÑикаÑии.
Summary
The ruby-align CSS property defines the distribution of the different ruby elements over the base.
| ÐаÑалÑное знаÑение | space-around |
|---|---|
| ÐÑименÑеÑÑÑ Ðº | базовÑе ÑлеменÑÑ ruby, анноÑаÑии к ruby, базовÑе ruby конÑейнеÑÑ, конÑейнеÑÑ Ð°Ð½Ð½Ð¾ÑаÑий к ruby |
| ÐаÑледÑеÑÑÑ | да |
| ÐбÑабоÑка знаÑÐµÐ½Ð¸Ñ | как Ñказано |
| Animation type | by computed value type |
Syntax
/* 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;
Values
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.
Formal syntax
ruby-align =
start |
center |
space-between |
space-around
Examples
This HTML will render differently with each value of ruby-align:
<ruby>
<rb>This is a long text to check</rb>
<rp>ï¼</rp><rt>short ruby</rt><rp>ï¼</rp>
</ruby>
Ruby aligned at the start of the base text
<ruby>
<rb>This is a long text to check</rb>
<rp>ï¼</rp><rt>short ruby</rt><rp>ï¼</rp>
</ruby>
ruby {
ruby-align: start;
}
This gives the following result:
Ruby aligned at the center of the base text
<ruby>
<rb>This is a long text to check</rb>
<rp>ï¼</rp><rt>short ruby</rt><rp>ï¼</rp>
</ruby>
ruby {
ruby-align: center;
}
This gives the following result:
Extra space distributed between ruby elements
<ruby>
<rb>This is a long text to check</rb>
<rp>ï¼</rp><rt>short ruby</rt><rp>ï¼</rp>
</ruby>
ruby {
ruby-align: space-between;
}
This gives the following result:
Extra space distributed between and around ruby element
<ruby>
<rb>This is a long text to check</rb>
<rp>ï¼</rp><rt>short ruby</rt><rp>ï¼</rp>
</ruby>
ruby {
ruby-align: space-around;
}
This gives the following result:
СпеÑиÑикаÑии
| Specification |
|---|
| CSS Ruby Annotation Layout Module Level 1> # ruby-align-property> |
СовмеÑÑимоÑÑÑ Ñ Ð±ÑаÑзеÑами
СмоÑÑиÑе Ñакже
- HTML Ruby elements:
<ruby>,<rt>,<rp>, and<rtc>. - CSS Ruby properties:
ruby-position,ruby-merge.