<q> Quote Element - (X)HTML Element Reference :: webDev

Dropping q Elements

Dropping q elements. Everybody knows that styling q elements is still not working consistently (just think :lang()). Next, the HTML 5 spec is quite clear: “The use of q elements to mark up quotations is entirely optional.” Hence, gone they are, the qs.

>q<

The >q< element is little brother (or sister) to the >blockquote< element. Where >blockquote< creates a distinct block of quoted text, the more svelte >q< element is used for inline quotations. It’s intended that the browser should insert the necessary quotation marks, the style of which should depend on the language of the document or that section of the document, rather than the author adding quotation marks, which can cause double quotation marks to appear.

The >q< element is used to mark up a quotation, possibly with attribution in the form of a >q cite=""< attribute, although this is optional.

The >q< element doesn’t cause any discernible change in the style of text in any browser tested, but it does add the necessary quotation marks in all the browsers that were tested (with the exception of Internet Explorer). Firefox (2.0, Safari (3.0 & Opera (9.5) have partial rather than full support because of the browsers’ failure to reveal the information contained in the >q cite=""< attribute.

The >q cite=""< attribute provides the source of the quotation in the form of a URI.

Should I Use Quotation Marks Within OR Around A >q< Element?

Should I use quotation marks within or around a <q> element?
No, the specification clearly says that it is the responsibility of the user agent to add quotation marks to inline quotations. Unfortunately, some older browsers (such as Internet Explorer 6) do not comply with the specification and will not add quotation marks. An option is to insert the quotation marks with JavaScript, and use some special styling with CSS to insert quotations for IE users with JavaScript disabled. Some CSS-only solutions have been proposed, but they will fail in non-CSS browsers such as Lynx.

HTML <q> Tag

The >q< tag defines a short quotation.

The browser will insert quotation marks around the quotation.

<q> is an short inline quotation

The <q> element is intended for short (inline) quotations from a work that do not require the paragraph breaks of the <blockquote> element.

<q> has <q cite=""> attribute.

The <q cite=""> attribute is of type CDATA and by default it is implied.

The <q cite=""> attribute accepts a Uniform Resource Identifier as per RFC2396; a Uniform Resource Locator (URL) is a URI; URI for source document or msg.

<q> Object

Internet Explorer 8 and later. The value of the <q cite=""> attribute depends on the current document compatibility mode. In addition, quotation marks are now added to the content of the element.

<q> Quote (X)HTML Element Reference - (X)HTML webDev