q element represents some phrasing content quoted from another source.
Quotation punctuation (such as quotation marks) that is quoting the contents of the element must not appear immediately before, after, or inside
q elements; they will be inserted into the rendering by the user agent.
Content inside a
q element must be quoted from another source, whose address, if it has one, may be cited in the
cite attribute. The source may be fictional, as when quoting characters in a novel or screenplay.
cite attribute is present, it must be a valid URL potentially surrounded by spaces.
q element must not be used in place of quotation marks that do not represent quotes; for example, it is inappropriate to use the
q element for marking up sarcastic statements.
The use of
q elements to mark up quotations is entirely optional; using explicit quotation punctuation without
q elements is just as correct.
Here is a simple example of the use of the
<p>The man said <q>Things that are impossible just take longer</q>. I disagreed with him.</p>
Here is an example with both an explicit citation link in the
q element, and an explicit citation outside:
<p>The W3C page <cite>About W3C</cite> says the W3C's mission is <q cite="http://www.w3.org/Consortium/">To lead the World Wide Web to its full potential by developing protocols and guidelines that ensure long-term growth for the Web</q>. I disagree with this mission.</p>
In the following example, the quotation itself contains a quotation:
<p>In <cite>Example One</cite>, he writes <q>The man said <q>Things that are impossible just take longer</q>. I disagreed with him</q>. Well, I disagree even more!</p>
In the following example, quotation marks are used instead of the
<p>His best argument was ❝I disagree❞, which I thought was laughable.</p>
In the following example, there is no quote — the quotation marks are used to name a word. Use of the
q element in this case would be inappropriate.
<p>The word "ineffable" could have been used to describe the disaster resulting from the campaign's mismanagement.</p>