--- title: ruby-align slug: Web/CSS/ruby-align translation_of: Web/CSS/ruby-align ---
The ruby-align
CSS property defines the distribution of the different ruby elements over the base.
{{cssinfo}}
/* 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
center
space-between
space-around
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 { ruby-align:start; }
This gives the following result:
{{EmbedLiveSample("Ruby_aligned_at_the_start_of_the_base_text", 180, 40)}}
ruby { ruby-align:center; }
This gives the following result:
{{EmbedLiveSample("Ruby_aligned_at_the_center_of_the_base_text", 180, 40)}}
ruby { ruby-align:space-between; }
This gives the following result:
{{EmbedLiveSample("Extra_space_distributed_between_ruby_elements", 180, 40)}}
ruby { ruby-align:space-around; }
This gives the following result:
{{EmbedLiveSample("Extra_space_distributed_between_and_around_ruby_element", 180, 40)}}
Specification | Status | Comment |
---|---|---|
{{ SpecName('CSS3 Ruby', '#ruby-align-property', 'ruby-align') }} | {{ Spec2('CSS3 Ruby') }} | Initial definition |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{ CompatNo }} | {{CompatGeckoDesktop(38)}} | {{ CompatNo }} [1] | {{ CompatNo }} | {{ CompatNo }} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatNo }} | {{CompatGeckoMobile(38)}} | {{ CompatNo }} [1] | {{ CompatNo }} | CompatNo |
[1] Internet Explorer, since IE9, implements an early draft of CSS Ruby where ruby-align
had the following properties: auto
, left
, center
, right
, distribute-letter
, distribute-space
, and line-edge
. Here is a rough conversion table:
IE syntax | Standard syntax |
---|---|
auto |
Don't use ruby-align |
left |
Use start (in ltr scripts) |
center |
center |
right |
Use start (in rtl scripts) |
distribute-letter |
No direct equivalent, use space-between or space-around |
distribute-space |
space-around |
line-edge |
No direct equivalent. |