aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/ruby/index.html
blob: 569be565bf61047212ff782d6a4e0767d8ac5924 (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
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
---
title: <ruby>
slug: Web/HTML/Element/ruby
tags:
  - Element
  - HTML
  - Ruby
  - Web
  - zh-Hans
  - 汉字
translation_of: Web/HTML/Element/ruby
---
<p>{{HTMLRef}}</p>

<p><strong>HTML <code>&lt;ruby&gt;</code> 元素 </strong>被用来展示东亚文字注音或字符注释。</p>



<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories" title="HTML/Content_categories">内容范畴</a></th>
   <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content" title="HTML/Content_categories#Phrasing_content">流式内容</a>, <a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">短语内容</a>, palpable content.</td>
  </tr>
  <tr>
   <th scope="row">允许内容</th>
   <td><a href="/en-US/docs/Web/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">短语内容</a></td>
  </tr>
  <tr>
   <th scope="row">标签省略</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">允许的父级元素</th>
   <td>See prose</td>
  </tr>
  <tr>
   <th scope="row">DOM 接口</th>
   <td>{{domxref("HTMLElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Attributes" name="Attributes"><strong>属性</strong></h2>

<p>本元素支持 <a href="/en-US/docs/Web/HTML/Global_attributes" title="HTML/Global attributes">全局属性</a></p>

<h2 id="Examples" name="Examples"><strong>示例</strong></h2>

<h3 id="示例1_字">示例1: 字</h3>

<pre class="brush:html">&lt;ruby&gt;&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;han&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;zi&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;
&lt;/ruby&gt;</pre>

<h3 id="示例2_词">示例2: 词</h3>

<pre class="brush:html">&lt;ruby&gt;
  明 日 &lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;ming ri&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;
&lt;/ruby&gt;</pre>

<h2 id="Specifications" name="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('HTML WHATWG', 'text-level-semantics.html#the-ruby-element', '&lt;ruby&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-ruby-element', '&lt;ruby&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性"><strong>浏览器兼容性</strong></h2>

<div id="compat-desktop">{{Compat("html.elements.ruby")}}</div>

<h2 id="See_also" name="See_also">参阅</h2>

<ul>
 <li>{{HTMLElement("rt")}}</li>
 <li>{{HTMLElement("rp")}}</li>
 <li>{{HTMLElement("rb")}}</li>
 <li>{{HTMLElement("rtc")}}</li>
 <li>{{HTMLElement("rbc")}}</li>
 <li>{{CSSxRef("text-transform")}}: full-size-kana</li>
</ul>

<div id="gtx-trans" style="position: absolute; left: 5px; top: 141px;">
<div class="gtx-trans-icon"></div>
</div>