1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
---
title: ruby-align
slug: Web/CSS/ruby-align
translation_of: Web/CSS/ruby-align
---
<div>{{CSSRef}}{{SeeCompatTable}}</div>
<h2 id="Summary">Summary</h2>
<p>The <code><strong>ruby-align</strong></code> CSS property defines the distribution of the different ruby elements over the base.</p>
<p>{{cssinfo}}</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush:css">/* 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;
</pre>
<h3 id="Values">Values</h3>
<dl>
<dt><code>start</code></dt>
<dd>Is a keyword indicating that the ruby will be aligned with the start of the base text.</dd>
<dt><code>center</code></dt>
<dd>Is a keyword indicating that the ruby will be aligned at the middle of the base text</dd>
<dt><code>space-between</code></dt>
<dd>Is a keyword indicating that the extra space will be distributed between the elements of the ruby.</dd>
<dt><code>space-around</code></dt>
<dd>Is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it.</dd>
</dl>
<h3 id="Formal_syntax">Formal syntax</h3>
{{csssyntax}}
<h2 id="Examples">Examples</h2>
<p>This HTML will render differently with each value of <code>ruby-align</code>:</p>
<pre class="brush: html"><ruby>
<rb>This is a long text to check</rb>
<rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
</pre>
<h3 id="Ruby_aligned_at_the_start_of_the_base_text">Ruby aligned at the start of the base text</h3>
<pre class="brush: html" style="display: none;"><ruby>
<rb>This is a long text to check</rb>
<rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
</pre>
<pre class="brush: css">ruby {
ruby-align:start;
}</pre>
<p>This gives the following result:</p>
<p>{{EmbedLiveSample("Ruby_aligned_at_the_start_of_the_base_text", 180, 40)}}</p>
<h3 id="Ruby_aligned_at_the_center_of_the_base_text">Ruby aligned at the center of the base text</h3>
<pre class="brush: html" style="display: none;"><ruby>
<rb>This is a long text to check</rb>
<rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
</pre>
<pre class="brush: css">ruby {
ruby-align:center;
}</pre>
<p>This gives the following result:</p>
<p>{{EmbedLiveSample("Ruby_aligned_at_the_center_of_the_base_text", 180, 40)}}</p>
<h3 id="Extra_space_distributed_between_ruby_elements">Extra space distributed between ruby elements</h3>
<pre class="brush: html" style="display: none;"><ruby>
<rb>This is a long text to check</rb>
<rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
</pre>
<pre class="brush: css">ruby {
ruby-align:space-between;
}</pre>
<p>This gives the following result:</p>
<p>{{EmbedLiveSample("Extra_space_distributed_between_ruby_elements", 180, 40)}}</p>
<h3 id="Extra_space_distributed_between_and_around_ruby_element">Extra space distributed between and around ruby element</h3>
<pre class="brush: html" style="display: none;"><ruby>
<rb>This is a long text to check</rb>
<rp>(</rp><rt>short ruby</rt><rp>)</rp>
</ruby>
</pre>
<pre class="brush: css">ruby {
ruby-align:space-around;
}</pre>
<p>This gives the following result:</p>
<p>{{EmbedLiveSample("Extra_space_distributed_between_and_around_ruby_element", 180, 40)}}</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('CSS3 Ruby', '#ruby-align-property', 'ruby-align') }}</td>
<td>{{ Spec2('CSS3 Ruby') }}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("css.properties.ruby-align")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>HTML Ruby elements: {{HTMLElement("ruby")}}, {{HTMLElement("rt")}}, {{HTMLElement("rp")}}, and {{HTMLElement("rtc")}}.</li>
<li>CSS Ruby properties: {{cssxref("ruby-position")}}, {{cssxref("ruby-merge")}}.</li>
</ul>
|