HTML <q> ƙaɗa

定义和用法

<q> 标签定义短的引用。

浏览器通常会在引用周围插入引号。

提示:对于长的引用,请使用 <blockquote> 标签.

另请参阅:

HTML DOM 参考手册:Quote 对象

实例

例子 1

标记简短的引用:

<p>The goal of the World Wide Fund for Nature is:
<q>Build a future where people live in harmony with nature.</q>
We hope they succeed.</p>

Try It Yourself

例子 2

使用 CSS 设置 <q> 元素的样式:

<html>
<head>
<style>
q {
  color: gray;
  font-style: italic;
}
</style>
</head>
<body>
<p>The goal of the World Wide Fund for Nature is:
<q>Build a future where people live in harmony with nature.</q>
We hope they succeed.</p>
</body>
</html>

Try It Yourself

Attribute

Attribute Value Description
cite URL Specifies the source URL of the citation.

Global Attributes

<q> The tag also supports Global Attributes in HTML.

Event Attributes

<q> The tag also supports Event Attributes in HTML.

Default CSS Settings

Most browsers will use the following default values to display <q> Element:

q {
  display: inline;
}
q:before {
  content: open-quote;
}
q:after {
  content: close-quote;
}

Try It Yourself

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support