home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


BR indicates a line break. This is fundamentally different from a paragraph element—<BR> is treated as a character (like a hard carriage return), while P defines a text block as a paragraph. An example of BR is shown in Figure 6.9 and 6.10, where it is used to break lines in an ADDRESS. BR can also break lines in a poem, with P elements marking the different verses.

BR takes the standard “generic” attributes CLASS, ID, STYLE, and TITLE, but does not take LANG nor the “event-handling” attributes. These attributes were described earlier in this chapter.

In the case of text flow around right- and left-aligned images, tables, or other objects, an author must be able to specify how the text should break; that is, should the text simple continue at the next line that runs alongside the image, or should it break until the next line can be flush with the left, right, or both margins? In HTML, BR with an optional CLEAR can make this specification. The possible CLEAR values and their meanings are:

CLEAR=“left,” “right,” “all,” “none” (optional) <BR CLEAR="left"> breaks the line and moves the following text down until the text can be flushed with the left margin. <BR CLEAR="right"> breaks the line and moves the following text down until the right margin is clear. <BR CLEAR="all"> breaks the line and moves the following text down until both margins are clear. Last, <BR CLEAR="none"> is simply the default value, and is rarely specified in a document. It may, however, be useful to override a default text flow specified in an associated style sheet.

Note that HTML 4 recommends the use of style sheet rules, in place of a CLEAR attribute. For example, to implement a BR element that clears to the right margin, the STYLE element could contain:

<STYLE>
BR.rightimage  {clear: right}
</STYLE>

with the body of the document containing BR elements of the form:

Here is some text .... <BR CLASS="rightimage">

Some example of BR elements are shown in Figures 6.43 and 6.44.

Special Markup: DEL, INS, and NOSCRIPT

There are two special elements, INS and DEL, used to denote inserted and deleted blocks of a document. These are designed for use in document management and revision, where it is important to track the various changes that have taken place in the document and either display these changes or let the reader toggle between different versions.

Because of this purpose, INS and DEL are neither inline nor block elements: These elements can, in fact, contain either block or inline elements, depending on what content has been inserted or deleted. Figure 6.48 illustrates a possible rendering for the content marked up by these elements. Note, however, that this rendering can (and probably should) be altered using style sheet rules.

HTML 4 permits INS and DEL elements anywhere inside the BODY—including anywhere within any nonempty element lying inside the BODY, with the exception of SCRIPT and TEXTAREA. Most commonly, INS and DEL are used to indicate inserted or deleted blocks of text, but the markup model lets you also use INS and DEL to delimit inserted and deleted table rows, or inserted or deleted LI list items. Note, however, however, that Internet Explorer 4—the only browser to currently support INS and DEL—does not support these elements around TD, TR or other table-markup elements.

You must not use these elements to break the distinction between block-level and inline elements. For example, you cannot use markup of the form:

<EM> emphasized text
<INS> 
<DIV> here is a block of text
</DIV>
</INS>
and some more emphasized text
</EM>

Although the content model formally permits this, it is nevertheless illegal, and EM element cannot contain a DIV. A general rule is to look at the document with the INS or DEL elements removed: If the resulting markup is illegal, then the INS or DEL elements are illegally placed in the document. This is why this book does not mention INS and DEL elements in the content rules listed earlier in this chapter, and also in Chapter 7.

Last, the NOSCRIPT element contains HTML markup to be displayed by browsers that do not support scripting.

NOSCRIPT is supported by most current browsers. DEL and INS are supported by Internet Explorer 4, but not Netscape Navigator 4.

DEL Element: Deleted Text

Usage: <DEL> ... </DEL>
Can Contain: ADDRESS, BLOCKQUOTE, CENTER, COLGROUP, DD, DIR, DIV, DL, DT, FIELDSET, FORM, Hn, HR, [ISINDEX], LI, MENU, NOFRAMES, NOSCRIPT, OL, P, PRE, TABLE, TD, TBODY, TFOOT, TH, THEAD, TR, UL,
DEL, INS,
characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, CAPTION, IFRAME, IMG, INPUT, LABEL, MAP, OBJECT, OPTGROUP, OPTION, SCRIPT, SELECT, TEXTAREA
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CENTER, COLGROUP, DIR, DIV, DD, DL, DT, FIELDSET, FORM, Hn, LI, MENU, NOFRAMES, NOSCRIPT, OL, P, PRE, TABLE, TD, TBODY, TFOOT, TH, THEAD, TR, UL,
DEL, INS,
character highlighting, A, APPLET, BUTTON, CAPTION, IFRAME, LABEL, MAP, OBJECT, OPTGROUP, OPTION, SELECTAttributes:
CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers,
CITE, DATETIME

This element marks text that has been deleted. The browser should display this in a distinctive way, for example by rendering it in a different color or with a line struck through it. This behavior can, of course, be modified using a style sheet. This element is supported by Internet Explorer 4 (by default, the text is rendered with an underline), but is not supported by Netscape Navigator 4.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.