HTML <q> Tag

Definition und Verwendung

<q> Das Tag definiert kurze Zitate.

Browser fügen normalerweise Anführungszeichen um die Zitate ein.

Hinweis:Für lange Zitate verwenden Sie: <blockquote>-Tag.

Weitere Informationen:

HTML DOM Referenzhandbuch:Quote-Objekt

Beispiel

Beispiel 1

Kurzquotationen markieren:

<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

Beispiel 2

CSS wird verwendet, um den Stil des <q>-Elements zu setzen:

<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 display the following default values <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