HTML <q>タグ


短い引用をマークアップします。

<p>WWF's goal is to:
<q>Build a future where people live in harmony with nature.</q>
We hope they succeed.</p>

以下の「自分で試してみてください」の例をもっと見てください。


定義と使用法

<q>タグは短い引用を定義します

ブラウザは通常、引用符を引用符で囲みます。

ヒント:長い引用には <blockquote>を使用してください。


ブラウザのサポート

Element
<q> Yes Yes Yes Yes Yes

属性

Attribute Value Description
cite URL Specifies the source URL of the quote


グローバル属性

この<q>タグは、HTMLのグローバル属性もサポートしています。


イベント属性

この<q>タグは、HTMLのイベント属性もサポートしています。


その他の例

CSSを使用して<q>要素のスタイルを設定します。

<html>
<head>
<style>
q {
  color: gray;
  font-style: italic;
}
</style>
</head>
<body>

<p>WWF's goal is to:
<q>Build a future where people live in harmony with nature.</q>
We hope they succeed.</p>

</body>
</html>

関連ページ

HTML DOMリファレンス:見積もりオブジェクト


デフォルトのCSS設定

ほとんどのブラウザは<q>、次のデフォルト値で要素を表示します。

q {
  display: inline;
}

q:before {
  content: open-quote;
}

q:after {
  content: close-quote;
}