q element
If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.
Table of contents
Description
The q
element allows authors to insert quotations in the form of intra-paragraph content (runs of text), in contrast with blockquote
that allows blocks of content to be quoted. Additionally, the resource from where the quotation was extracted can be specified in the cite
attribute, by providing its URL.
Examples
The following example shows a user quoting the statement of another person and adding some comments about it.
<p>I personally don't believe <q>...otherwise I'll have to find another solution!</q> to be a collaborative approach.</p>
I personally don't believe ...otherwise I'll have to find another solution!
to be a collaborative approach.
In the next example we'll be making use of the cite
attribute to establish a reference to the source of the quotation.
<p>Again, he risks letting them know he doesn't like much the idea of betraying his brothers when he interrupts <q cite="http://www.georgerrmartin.com/grrm_book/a-clash-of-kings-a-song-of-ice-and-fire-book-two/">A bold plan, Father, but the lords in their castles...</q>.</p>
Again, he risks letting them know he doesn't like much the idea of betraying his brothers when he interrupts A bold plan, Father, but the lords in their castles...
.
Attributes
Specific attributes
cite
The URL of the resource from where the quotation has been extracted.
Example
<p>Totalitarianism or totalitarian state is, as they suggested, <q cite="http://en.wikipedia.org/wiki/Totalitarianism">...a concept used by some political scientists to describe a political system in which the state holds total authority over the society...</q>.</p>
Totalitarianism or totalitarian state is, as they suggested, ...a concept used by some political scientists to describe a political system in which the state holds total authority over the society...
.
Global attributes
For information about global attributes refer to this list of global attributes in HTML5.
Events
Global events
For information about global events refer to this list of global events in HTML5.