2021年1月15日 37点热度 0人点赞






9.2.2 Quotations: The BLOCKQUOTE and Q elements<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT) -- long quotation --><!ATTLIST BLOCKQUOTE %attrs;
-- %coreattrs, %i18n, %events -- cite
#IMPLIED -- URI for source document or msg -- ><!ELEMENT Q - - (%inline;)*
-- short inline quotation --><!ATTLIST Q %attrs;
-- %coreattrs, %i18n, %events -- cite
#IMPLIED -- URI for source document or msg -- >

这两个便签指名包含的内容为引用文字. BLOCKQUOTE 用于长文字的引用(block-level content) 而 Q 用于短文字的引用(inline content) 且不允许引用的句子不完整。

这个例子的文字来自 "The Two Towers", 作者 J.R.R. Tolkien, 最为引用文字.

<BLOCKQUOTE cite=""><P>They went in single file, running like hounds on a strong scent,and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed.</P></BLOCKQUOTE>


For longer quotations that form one or more paragraphs, the <blockquote> element should be used. CSS can then be used to style the quotation. Note that text is not allowed directly inside a <blockquote> element – it must be contained in an element, usually a <p> element.
Example:<blockquote cite=""> <p>&#8220;The following sections discuss issues surrounding the structuring of text. Elements that present text (alignment elements, font elements, style sheets, etc.) are discussed elsewhere in the specification. For information about characters, please consult the section on the document character set.&#8221;</p></blockquote>


Content model differences

An element type’s content model describes what may be contained by an instance of the element type. The most important difference in content models between Transitional and Strict is that blockquote, body, and form elements may only contain block level elements. A few examples:

text and images are not allowed immediately inside the body element, and need to be contained in a block level element like p or div
input elements must not be direct descendants of a form element
text in blockquote elements must be wrapped in a block level element like p or div