diff options
Diffstat (limited to 'files/ru/web/css/ruby-align/index.html')
-rw-r--r-- | files/ru/web/css/ruby-align/index.html | 234 |
1 files changed, 234 insertions, 0 deletions
diff --git a/files/ru/web/css/ruby-align/index.html b/files/ru/web/css/ruby-align/index.html new file mode 100644 index 0000000000..24870c5d3d --- /dev/null +++ b/files/ru/web/css/ruby-align/index.html @@ -0,0 +1,234 @@ +--- +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> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<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>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari (WebKit)</th> + </tr> + <tr> + <td rowspan="1">Basic support</td> + <td rowspan="1">{{ CompatNo }} </td> + <td>{{CompatGeckoDesktop(38)}}</td> + <td rowspan="1">{{ CompatNo }} [1]</td> + <td rowspan="1">{{ CompatNo }} </td> + <td rowspan="1">{{ CompatNo }}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Phone</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{ CompatNo }} </td> + <td>{{CompatGeckoMobile(38)}}</td> + <td>{{ CompatNo }} [1]</td> + <td>{{ CompatNo }} </td> + <td>CompatNo</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Internet Explorer, since IE9, implements an early draft of CSS Ruby where <code>ruby-align</code> had the following properties: <code>auto</code>, <code>left</code>, <code>center</code>, <code>right</code>, <code>distribute-letter</code>, <code>distribute-space</code>, and <code>line-edge</code>. Here is a rough conversion table:</p> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">IE syntax</th> + <th scope="col">Standard syntax</th> + </tr> + </thead> + <tbody> + <tr> + <td><code>auto</code></td> + <td>Don't use <code>ruby-align</code></td> + </tr> + <tr> + <td><code>left</code></td> + <td>Use <code>start</code> (in ltr scripts)</td> + </tr> + <tr> + <td><code>center</code></td> + <td><code>center</code></td> + </tr> + <tr> + <td><code>right</code></td> + <td>Use <code>start</code> (in rtl scripts)</td> + </tr> + <tr> + <td><code>distribute-letter</code></td> + <td>No direct equivalent, use <code>space-between</code> or <code>space-around</code></td> + </tr> + <tr> + <td><code>distribute-space</code></td> + <td><code>space-around</code></td> + </tr> + <tr> + <td><code>line-edge</code></td> + <td>No direct equivalent.</td> + </tr> + </tbody> +</table> + +<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> |