Quotations

HTML provides the inline-level q and block-level blockquote elements for quotations. The HTML 4.01 specification declares that these elements are supposed to support the cite attribute, which is meant to store a URI that qualifies as a primary source. In practice, this requirement is ignored by all browsers except Internet Explorer 8, and thus forces user-facing citations to be crammed into the cite and a elements. However, for the sake of preserving metadata, the URI values that are valid for the cite attribute should still be provided.

The blockquote element has three salient characteristics: user agent styles apply a discernible margin-left value to it, quotation marks must be added deliberately to its content, and Strict DTDs require that it contain at least one block element (usually a paragraph).

Quotation markup provides only limited support for the :before and :after pseudoelements, which are unsupported by all versions of Internet Explorer except 8. In browsers that do support :before and :after pseudoelements, opening and closing quotes are specified by the user agent stylesheet for the content of the q element; in no current environment is the blockquote element likewise endowed. To add typographically appropriate quotation marks to blockquote elements in those browsers, you should add the following lines to a style block:

blockquote:before { content: open-quote; }
blockquote:after { content: close-quote; }

The :before and :after pseudoelements are used as a matter ...

Get HTML & CSS: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.