summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Frt.html
blob: 568e0dee49392af9c861e6f1d633cee8e35dded6 (plain)
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
<header><h1>&lt;rt&gt;: The Ruby Text element</h1></header><div class="section-content"><p>The <code>&lt;rt&gt;</code> <a href="../index">HTML</a> element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The <code>&lt;rt&gt;</code> element must always be contained within a <a href="ruby"><code>&lt;ruby&gt;</code></a> element.</p></div>
<h2 id="try_it">Try it</h2>
<div class="section-content">
<iframe class="interactive is-tabbed-shorter-height" height="200" src="https://interactive-examples.mdn.mozilla.net/pages/tabbed/rt.html" title="MDN Web Docs Interactive Example" loading="lazy"></iframe> <p>See the article about the <a href="ruby"><code>&lt;ruby&gt;</code></a> element for more examples.</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="examples">Examples</h2>

<h3 id="using_ruby_annotations">Using ruby annotations</h3>
<div class="section-content">
<p>This simple example provides Romaji transliteration for the kanji characters within the <a href="ruby"><code>&lt;ruby&gt;</code></a> element:</p> <div class="code-example">
<p class="example-header"><span class="language-name">html</span></p>
<pre data-signature="ERUjSl+Rnqs4e1ggHovuFevQrhW8y+J1z4R+k7i+98I=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ruby</span><span class="token punctuation">&gt;</span></span> 漢 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>rt</span><span class="token punctuation">&gt;</span></span>Kan<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>rt</span><span class="token punctuation">&gt;</span></span> 字 <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>rt</span><span class="token punctuation">&gt;</span></span>ji<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>rt</span><span class="token punctuation">&gt;</span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ruby</span><span class="token punctuation">&gt;</span></span>
</pre>
</div>  <h4 id="result">Result</h4>
<div class="code-example" id="sect1">

<iframe class="sample-code-frame" title="Using ruby annotations sample" id="frame_using_ruby_annotations" width="600" height="60" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/rt/runner.html?id=using_ruby_annotations" loading="lazy"></iframe>
</div>
</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>
<a href="../content_categories#phrasing_content">Phrasing content</a>.</td> </tr> <tr> <th scope="row">Tag omission</th> <td> The end tag may be omitted if the <code>&lt;rt&gt;</code> element is immediately followed by an <code>&lt;rt&gt;</code> or <a href="rp"><code>&lt;rp&gt;</code></a> 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>&lt;ruby&gt;</code></a> element.</td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><a href="https://www.w3.org/TR/html-aria/#dfn-no-corresponding-role" target="_blank">No corresponding role</a></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/text-level-semantics.html#the-rt-element">HTML Standard <br><small># the-rt-element</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>rt</code></th>
<td class="bc-supports-yes">5</td>
<td class="bc-supports-yes">79</td>
<td class="bc-supports-yes">38</td>
<td class="bc-supports-yes">5</td>
<td class="bc-supports-yes">15</td>
<td class="bc-supports-yes">5</td>
<td class="bc-supports-yes">4.4</td>
<td class="bc-supports-yes">18</td>
<td class="bc-supports-yes">38</td>
<td class="bc-supports-yes">14</td>
<td class="bc-supports-yes">4.2</td>
<td class="bc-supports-yes">1.0</td>
</tr></tbody>
</table></div>
<h2 id="see_also">See also</h2>
<div class="section-content"><ul> <li><a href="ruby"><code>&lt;ruby&gt;</code></a></li> <li><a href="rp"><code>&lt;rp&gt;</code></a></li> <li><a href="rb"><code>&lt;rb&gt;</code></a></li> <li><a href="rtc"><code>&lt;rtc&gt;</code></a></li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform"><code>text-transform: full-size-kana</code></a></li> </ul></div><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2005&ndash;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/rt" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt</a>
  </p>
</div>