<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> 元素。

內容類別 流內容段落式內容、捫及內容。
允許內容 段落式內容
標籤省略 不允許,開始和結束標籤都是必須的。
允許父元素 任何允許段落式內容的元素
DOM 介面 HTMLQuoteElement

備註: 多數現代標準瀏覽器,如 Mozilla Firefox, Opera, Safari 會在 <q> 元素周圍添加引號;但有些瀏覽器(如 Internet Explorer)可能不會針對引用添加任何樣式,不過這些都可以透過樣式規則套用。

屬性

這個元素包含 全域屬性

cite

這個屬性值為可以指定引用文件、或信息來源的 URL。這個屬性預期導向信息說明的上下文、或是引文參照。

範例

HTML 內容

html
<p>
  每當阿尼掛掉的時候,屎蛋會說:
  <q
    cite="https://zh.wikipedia.org/zh-tw/%E8%82%AF%E5%B0%BC%C2%B7%E9%BA%A6%E5%85%8B%E5%BA%B7%E7%B1%B3%E5%85%8B">
    我的天啊!阿尼他被掛掉了! </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

參閱