diff options
Diffstat (limited to 'devdocs/html/element%2Frb.html')
| -rw-r--r-- | devdocs/html/element%2Frb.html | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/devdocs/html/element%2Frb.html b/devdocs/html/element%2Frb.html new file mode 100644 index 00000000..cebee52a --- /dev/null +++ b/devdocs/html/element%2Frb.html @@ -0,0 +1,91 @@ +<header><h1><rb>: The Ruby Base element</h1></header><div class="section-content"> +<div class="notecard deprecated" id="sect1"><p><strong>Deprecated:</strong> This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the <a href="#browser_compatibility">compatibility table</a> at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.</p></div> <p>The <code><rb></code> <a href="../index">HTML</a> element is used to delimit the base text component of a <a href="ruby"><code><ruby></code></a> annotation, i.e. the text that is being annotated. One <code><rb></code> element should wrap each separate atomic segment of the base text.</p> +</div> +<h2 id="attributes">Attributes</h2> +<div class="section-content"><p>This element only includes the <a href="../global_attributes">global attributes</a>.</p></div> +<h2 id="usage_notes">Usage notes</h2> +<div class="section-content"><ul> <li>Ruby annotations are for showing pronunciation of East Asian characters, like using Japanese furigana or Taiwanese bopomofo characters. The <code><rb></code> element is used to separate out each segment of the ruby base text.</li> <li>Even though <code><rb></code> is not a <a href="https://developer.mozilla.org/en-US/docs/Glossary/Void_element">void element</a>, it is common to just include the opening tag of each element in the source code, so that the ruby markup is less complex and easier to read. The browser can then fill in the full element in the rendered version.</li> <li>You need to include one <a href="rt"><code><rt></code></a> element for each base segment/<code><rb></code> element that you want to annotate.</li> </ul></div> +<h2 id="examples">Examples</h2> + +<h3 id="using_rb">Using rb</h3> +<div class="section-content"> +<p>In this example, we provide an annotation for the original character equivalent of "Kanji":</p> <div class="code-example"> +<p class="example-header"><span class="language-name">html</span></p> +<pre data-signature="6okhRiocfiWkPkX6HnFhYov0ZspFaOZmHPeNVDVt8kM=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ruby</span><span class="token punctuation">></span></span> + <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rb</span><span class="token punctuation">></span></span>漢<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rb</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rb</span><span class="token punctuation">></span></span>字 <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rb</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>(<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rt</span><span class="token punctuation">></span></span>kan<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rt</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rt</span><span class="token punctuation">></span></span>ji<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rt</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>)<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>ruby</span><span class="token punctuation">></span></span> +</pre> +</div> <p>Note how we've included two <code><rb></code> elements, to delimit the two separate parts of the ruby base text. The annotation on the other hand is delimited by two <a href="rt"><code><rt></code></a> elements.</p> <h4 id="result">Result</h4> +<div class="code-example" id="sect2"> + +<iframe class="sample-code-frame" title="Using rb sample" id="frame_using_rb" width="100%" height="60" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/rb/runner.html?id=using_rb" loading="lazy"></iframe> +</div> +</div> +<h3 id="separate_annotations">Separate annotations</h3> +<div class="section-content"> +<p>Note that we could also write this example with the two base text parts annotated completely separately. In this case we don't need to include <code><rb></code> elements:</p> <div class="code-example"> +<p class="example-header"><span class="language-name">html</span></p> +<pre data-signature="Y+5q/G3EBi/ofswS5LfyI/FrJgypPFnlRQxpSurHYlA=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ruby</span><span class="token punctuation">></span></span> + 漢 <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>(<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rt</span><span class="token punctuation">></span></span>Kan<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rt</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>)<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span> 字 <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>(<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rt</span><span class="token punctuation">></span></span>ji<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rt</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>rp</span><span class="token punctuation">></span></span>)<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>rp</span><span class="token punctuation">></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>ruby</span><span class="token punctuation">></span></span> +</pre> +</div> <h4 id="result_2">Result</h4> +<div class="code-example" id="sect3"> + +<iframe class="sample-code-frame" title="Separate annotations sample" id="frame_separate_annotations" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/rb/runner.html?id=separate_annotations" loading="lazy"></iframe> +</div> <p>See the article about the <a href="ruby"><code><ruby></code></a> element for further examples.</p> +</div> +<h2 id="technical_summary">Technical summary</h2> +<div class="section-content"><figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td>None.</td> </tr> <tr> <th scope="row">Permitted content</th> <td>As a child of a <a href="ruby"><code><ruby></code></a> element.</td> </tr> <tr> <th scope="row">Tag omission</th> <td> The end tag can be omitted if the element is immediately followed by an <a href="rt"><code><rt></code></a>, <a href="rtc"><code><rtc></code></a>, or <a href="rp"><code><rp></code></a> element or another <code><rb></code> element, or if there is no more content in the parent element. </td> </tr> <tr> <th scope="row">Permitted parents</th> <td>A <a href="ruby"><code><ruby></code></a> element.</td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>Any</td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement"><code>HTMLElement</code></a></td> </tr> </tbody> </table></div></figure></div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/obsolete.html#rb">HTML Standard <br><small># rb</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody><tr> +<th><code>rb</code></th> +<td class="bc-supports-yes"><details><summary>5</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>79</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes">38</td> +<td class="bc-supports-yes">5</td> +<td class="bc-supports-yes"><details><summary>15</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>5</summary>Safari has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>4.4</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>18</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes">38</td> +<td class="bc-supports-yes"><details><summary>14</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>4.2</summary>Safari has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +<td class="bc-supports-yes"><details><summary>1.0</summary>Blink has support for parsing the <code>rb</code> element, but not for rendering <code>rb</code> content as expected.</details></td> +</tr></tbody> +</table></div> +<h2 id="see_also">See also</h2> +<div class="section-content"><ul> <li><a href="ruby"><code><ruby></code></a></li> <li><a href="rt"><code><rt></code></a></li> <li><a href="rp"><code><rp></code></a></li> <li><a href="rtc"><code><rtc></code></a></li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rb" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rb</a> + </p> +</div> |
