HTML/Elements/q

From W3C Wiki
< HTML‎ | Elements
Revision as of 14:58, 22 July 2011 by Plehegar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<q>

The <q> element represents some phrasing content quoted from another source.

Point

  • Content inside a q element must be quoted from another source. If it has address, a cite attribute should present. [Example B]
  • The use of q elements to mark up quotations is entirely optional; using explicit quotation punctuation without q elements is just as correct. [Example C]


HTML Attributes

  • cite = valid URL potentially surrounded by spaces
    Specifies the address in the quotation source. [Example B]


See also global attributes.


Examples

Example A

[try it]

<p>The man said <q>The quote is input here</q>.</p>

Q01.png

Example B

With the cite attribute [try it]:

<p>The man said <q cite="http://www.quote.com/sample.html">The quote is input here</q>.</p>

Q02.png

Example C

In the following example, quotation marks are used instead of the q element [try it]:

<p>The man said "The quote is input here".</p>

Q03.png

HTML Reference

The HTML5 specification defines the <q> element in 4.6.7 The q element.