Section 4.7. Block Quotes


4.7. Block Quotes

A common element in conventional documents is the block quote, a lengthy copy of text from another document. Traditionally, short quotes are set off with quotation marks, and block quotes are made entirely of separate paragraphs within the main document, typically with special indentation and sometimes italicizedfeatures that you may change through style or class definitions (see Chapter 8).

4.7.1. The <blockquote> Tag

All of the text within the <blockquote> and </blockquote> tags is set off from the regular document text, usually with indented left and right margins and sometimes in italicized typeface. Actual rendering varies from browser to browser, of course.

<blockquote>

Function

Defines a block quotation

Attributes

cite , class , dir , id , lang , onClick , onDblClick , onKeyDown , onKeyPress , onKeyUp , onMouseDown , onMouseMove , onMouseOut , onMouseOver , onMouseUp , style , title

End tag

</blockquote> ; never omitted

Contains

body_content

Used in

block



The HTML and XHTML standards allow any and all markup within the <blockquote> , although some physical and content-based styles may conflict with the font the browser uses for the block quote. Experimentation will reveal those warts.

The <blockquote> tag is often used to set off long quotations from other sources. For example, popular browsers display the following as an indented block of text:

 We acted incorrectly in arbitrarily changing the Kumquat Festival date. Quoting from the Kumquat Growers' Bylaws: <blockquote>   The date of the Kumquat Festival may only be changed by   a two-thirds vote of the General Membership, provided   that a <strong>60 percent quorum</strong> of the Membership   is present. </blockquote> (Emphasis mine) Since such a quorum was not present, the vote is invalid. 

Figure 4-19 displays the results.

Figure 4-19. Block quotes get their own space

4.7.1.1. The cite attribute

The cite attribute lets you indicate the source of a quote. The attribute's value should be a quote- enclosed URL that points to the online document and, if possible, the exact location in the document where the quote came from.

For instance, you could cite the specific section in the Kumquat Growers' Bylaws in our example. Presumably, someday the browser may actually let you click and view that specific citation via its embedded URL. Today, you must embed an explicit hyperlink to the document; see Chapter 6:

 <blockquote cite="http://www.kumquat.com/growers/bylaws#s23.4"> 

4.7.1.2. The dir and lang attributes

The dir attribute lets you advise the browser in which direction the text within the <blockquote> segment should be displayed, and lang lets you specify the language used within that tag. [The dir attribute, 3.6.1.1] [The lang attribute, 3.6.1.2]

4.7.1.3. The class, id, style, and title attributes

Use the style attribute to specify an inline style for the <blockquote> tag, or use the class attribute to apply a predefined style class to the tag. [Inline Styles: The style Attribute, 8.1.1] [Style Classes, 8.3]

You may assign a unique ID to the <blockquote> tag, as well as a title, using the respective attribute and accompanying quote-enclosed string value. [The id attribute, 4.1.1.4] [The title attribute, 4.1.1.5]

4.7.1.4. Event attributes

As with most other tagged segments of content, user - related events can happen in and around the <blockquote> tag, such as when a user clicks or double-clicks within its display space. The current browsers recognize many of these events. With the respective on attribute and value, you may react to those events by displaying a user dialog box or activating some multimedia event. [JavaScript Event Handlers, 12.3.3]

4.7.2. The <q> Tag

Introduced in HTML 4.0, the <q> tag is virtually identical to its <blockquote> counterpart . The difference is in their display and application. You use <q> for short quotes that may be inline with surrounding plain text. The HTML and XHTML standards dictate that the <q> -enclosed text begin and end with double quotes. All the popular browsers except Internet Explorer support <q> and place double quotes at each end of the enclosed text. The result is that you'll get two sets of quotation marks if you include your own quotes to satisfy Internet Explorer. Nonetheless, we recommend that you use the <q> tag, not only because we like standards, but because we see beyond their display effects to applications in document handling, information extraction, and so forth.

Use the <blockquote> tag, on the other hand, for longer segments that the browser will set offusually as an indented blockfrom the surrounding content, such as that shown in Figure 4-20.

<q>

Function

Defines a short quotation

Attributes

cite , class , dir , id , lang , onClick , onDblClick , onKeyDown , onKeyPress , onKeyUp , onMouseDown , onMouseMove , onMouseOut , onMouseOver , onMouseUp , style , title

End tag

</q> ; never omitted

Contains

body_content

Used in

text



4.7.2.1. The cite attribute

The cite attribute works with the <q> tag just like it does for the <blockquote> tag: it lets you indicate the source of a quote. The attribute's value should be a quote-enclosed URL that points to the online document and, if possible, the exact location in the document where the quote came from.

4.7.2.2. The dir and lang attributes

The dir attribute lets you advise the browser in which direction the text within the <q> segment should be displayed, and lang lets you specify the language used within that tag. [The dir attribute, 3.6.1.1] [The lang attribute, 3.6.1.2]

4.7.2.3. The class, id, style, and title attributes

Use the style attribute to specify an inline style for the <q> tag, or use the class attribute to apply a predefined style class to the tag. [Inline Styles: The style Attribute, 8.1.1] [Style Classes, 8.3]

You may assign a unique ID to the <q> tag, as well as a title, using the respective attribute and accompanying quote-enclosed string value. [The id attribute, 4.1.1.4] [The title attribute, 4.1.1.5]

4.7.2.4. Event attributes

As with most other tagged segments of content, user-related events can happen in and around the <q> tag, such as when a user clicks or double-clicks within its display space. The current browsers recognize many of these events. With the respective on attribute and value, you may react to those events by displaying a user dialog box or activating some multimedia event. [JavaScript Event Handlers, 12.3.3]



HTML & XHTML(c) The definitive guide
Data Networks: Routing, Security, and Performance Optimization
ISBN: 596527322
EAN: 2147483647
Year: 2004
Pages: 189
Authors: Tony Kenyon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net