<q>

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

HTML 引用标签 (<q>) 表示一个封闭的并且是短的行内引用的文本。这个标签是用来引用短的文本,所以请不要引入换行符; 对于长的文本的引用请使用 <blockquote> 替代。

Content categories Flow content, phrasing content, palpable content.
Permitted content Phrasing content.
标签省略 不允许,开始标签和结束标签都不能省略。
Permitted parent elements Any element that accepts phrasing content.
DOM interface HTMLQuoteElement

备注: 大多数现代浏览器,会为 <q> 文本添加引号。旧浏览器可能需要使用 CSS 添加引号。IE、Edge 与 Firefox、Chrome 引号样式略有不同。

属性

<q>标签拥有 全局属性.

cite

这个属性的值是 URL,意在指出被引用的文本的源文档或者源信息。这个属性重在解释这个引用的参考或者是上下文。

示例

HTML 内容

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

规范

Specification
HTML
# the-q-element

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
q
cite

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见