--- title: ruby-align slug: Web/CSS/ruby-align tags: - CSS - CSS プロパティ - CSS ルビ - Reference translation_of: Web/CSS/ruby-align --- <div>{{CSSRef}}{{SeeCompatTable}}</div> <p>CSS の <code><strong>ruby-align</strong></code> プロパティは、ベースに対するさまざまなルビの配分を定義します。</p> <pre class="brush:css no-line-numbers">/* キーワード値 */ ruby-align: start; ruby-align: center; ruby-align: space-between; ruby-align: space-around; /* グローバル値 */ ruby-align: inherit; ruby-align: initial; ruby-align: unset; </pre> <p>{{cssinfo}}</p> <h2 id="Syntax" name="Syntax">構文</h2> <h3 id="Values" name="Values">値</h3> <dl> <dt><code>start</code></dt> <dd>ルビをベーステキストの始点に揃えることを示すキーワードです。</dd> <dt><code>center</code></dt> <dd>ルビをベーステキストの中央に揃えることを示すキーワードです。</dd> <dt><code>space-between</code></dt> <dd>ルビの要素の範囲内に配分するよう、スペースを付加することを示すキーワードです。</dd> <dt><code>space-around</code></dt> <dd>ルビの要素の範囲内に配分するよう、スペースを付加することを示すキーワードです。また、ルビの周囲にもスペースを付加します。</dd> </dl> <h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3> {{csssyntax}} <h2 id="Examples" name="Examples">例</h2> <p>この HTML を、<code>ruby-align</code> のそれぞれの値でレンダリングします。</p> <pre class="brush: html"><ruby> <rb>確認用の長いテキスト</rb> <rp>(</rp><rt>短いルビ</rt><rp>)</rp> </ruby> </pre> <h3 id="Ruby_aligned_at_the_start_of_the_base_text" name="Ruby_aligned_at_the_start_of_the_base_text">ルビをベーステキストの始点に揃える</h3> <pre class="brush: html" style="display: none;"><ruby> <rb>確認用の長いテキスト</rb> <rp>(</rp><rt>短いルビ</rt><rp>)</rp> </ruby> </pre> <pre class="brush: css">ruby { ruby-align: start; }</pre> <p>結果は以下のとおりです。</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" name="Ruby_aligned_at_the_center_of_the_base_text">ルビをベーステキストの中央に揃える</h3> <pre class="brush: html" style="display: none;"><ruby> <rb>確認用の長いテキスト</rb> <rp>(</rp><rt>短いルビ</rt><rp>)</rp> </ruby> </pre> <pre class="brush: css">ruby { ruby-align: center; }</pre> <p>結果は以下のとおりです。</p> <p>{{EmbedLiveSample("Ruby_aligned_at_the_center_of_the_base_text", 180, 40)}}</p> <h3 id="Extra_space_distributed_between_ruby_elements" name="Extra_space_distributed_between_ruby_elements">ルビ要素の範囲内にスペースを配分する</h3> <pre class="brush: html" style="display: none;"><ruby> <rb>確認用の長いテキスト</rb> <rp>(</rp><rt>短いルビ</rt><rp>)</rp> </ruby> </pre> <pre class="brush: css">ruby { ruby-align: space-between; }</pre> <p>結果は以下のとおりです。</p> <p>{{EmbedLiveSample("Extra_space_distributed_between_ruby_elements", 180, 40)}}</p> <h3 id="Extra_space_distributed_between_and_around_ruby_elements" name="Extra_space_distributed_between_and_around_ruby_elements">ルビ要素内および周囲にスペースを配分する</h3> <pre class="brush: html" style="display: none;"><ruby> <rb>確認用の長いテキスト</rb> <rp>(</rp><rt>短いルビ</rt><rp>)</rp> </ruby> </pre> <pre class="brush: css">ruby { ruby-align: space-around; }</pre> <p>結果は以下のとおりです。</p> <p>{{EmbedLiveSample("Extra_space_distributed_between_and_around_ruby_elements", 180, 40)}}</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS3 Ruby', '#ruby-align-property', 'ruby-align')}}</td> <td>{{Spec2('CSS3 Ruby')}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> <p>{{Compat("css.properties.ruby-align")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>HTML のルビ関連要素: {{HTMLElement("ruby")}}, {{HTMLElement("rt")}}, {{HTMLElement("rp")}}, {{HTMLElement("rtc")}}</li> <li>CSS のルビ関連プロパティ: {{cssxref("ruby-position")}}, {{cssxref("ruby-merge")}}</li> </ul>