HTML <q> tag

Definitie en gebruik

<q> De tag definieert korte citaten.

Browsers voegen meestal aanhalingstekens toe rond de citaten.

Tip:Voor lange citaten, gebruik: <blockquote>-tag.

Zie ook:

HTML DOM referentiehandleiding:Quote-object

Voorbeeld

Voorbeeld 1

Markeer korte citaten:

<p>The World Wide Fund for Nature's goal is:
<q>Build a future where people and nature coexist in harmony.</q>
We hope they will succeed.</p>

Try it yourself

Voorbeeld 2

Gebruik CSS om de stijl van het <q>-element in te stellen:

<html>
<head>
<style>
q {
  color: gray;
  font-style: italic;
}
</style>
</head>
<body>
<p>The World Wide Fund for Nature's goal is:
<q>Build a future where people and nature coexist in harmony.</q>
We hope they will 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