aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/q/index.html
blob: d3fe0982a36d56635d51ac136c66c624afad5b83 (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
---
title: <q>
slug: Web/HTML/Element/q
tags:
  - HTML
  - Web
  - 引用
  - 标签
translation_of: Web/HTML/Element/q
---
<div>{{HTMLRef}}</div>

<p><em>HTML引用标签</em> (<strong>&lt;q&gt;</strong>)表示一个封闭的并且是短的行内引用的文本. 这个标签是用来引用短的文本,所以请不要引入换行符; 对于长的文本的引用请使用 {{HTMLElement("blockquote")}} 替代.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/en-US/docs/HTML/Content_categories">Content categories</a></th>
   <td><a href="/en-US/docs/HTML/Content_categories#Flow_content">Flow content</a>, <a href="/en-US/docs/HTML/Content_categories#Phrasing_content">phrasing content</a>, palpable content.</td>
  </tr>
  <tr>
   <th scope="row">Permitted content</th>
   <td><a href="/en-US/docs/HTML/Content_categories#Phrasing_content">Phrasing content</a>.</td>
  </tr>
  <tr>
   <th scope="row">Tag omission</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">Permitted parent elements</th>
   <td>Any element that accepts <a href="/en-US/docs/HTML/Content_categories#Phrasing_content">phrasing content</a>.</td>
  </tr>
  <tr>
   <th scope="row">DOM interface</th>
   <td>{{domxref("HTMLQuoteElement")}}</td>
  </tr>
 </tbody>
</table>

<p>{{NoteStart}}大多数现代浏览器,会为 &lt;q&gt; 文本添加引号(<q></q>)。旧浏览器可能需要使用 CSS 添加引号。<br>
 IE、Edge 与 Firefox、Chrome 引号样式略有不同。{{NoteEnd}}</p>

<h2 id="属性">属性</h2>

<p>&lt;q&gt;标签拥有 <a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes">全局属性</a>.</p>

<dl>
 <dt>{{htmlattrdef("cite")}}</dt>
 <dd>这个属性的值是URL,意在指出被引用的文本的源文档或者源信息. 这个属性重在解释这个引用的参考或者是上下文.</dd>
</dl>

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

<h3 id="HTML_内容">HTML 内容</h3>

<pre class="brush: html">&lt;p&gt;Everytime Kenny is killed, Stan will announce
   &lt;q cite="http://en.wikipedia.org/wiki/Kenny_McCormick#Cultural_impact"&gt;
     Oh my God, you/they killed Kenny!
   &lt;/q&gt;.
&lt;/p&gt;</pre>

<p>{{ EmbedLiveSample('示例') }}</p>

<h2 id="说明">说明</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-q-element', '&lt;q&gt;')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-q-element', '&lt;q&gt;')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td></td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'struct/text.html#h-9.2.2', '&lt;q&gt;')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

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

<p>{{Compat("html.elements.q")}}</p>

<h2 id="另见">另见</h2>

<ul>
 <li>The {{HTMLElement("blockquote")}} element for long quotations.</li>
 <li>The {{HTMLElement("cite")}} element for source citations.</li>
</ul>