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


NOBR marks a block of text that cannot contain line breaks. Thus, a block of text enclosed by a NOBR will be presented as a single line of text with no word wrapping, even if it scrolls off the edge of the screen. This is useful for strings of text that you do not wish broken at word spaces, regardless of the page layout.

You may wish to allow word breaks, but only at specific locations. This is the role of the WBR element, which is used inside NOBR to mark places where line breaking is allowed. WBR is essentially a conditional BR element, in that it does not force a line break, but instead permits one where a break would otherwise be forbidden.

NOEMBED Element: HTML Alternative to EMBED

Usage: <NOEMBED> ... </NOEMBED>
Can Contain: Unspecified, probably: ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV, DL, FIELDSET, FORM, Hn, HR, [ISINDEX], MENU, MULTICOL, NOEMBED, NOFRAMES, NOLAYER, NOSCRIPT, OL, P, PRE, TABLE, UL,
characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, EMBED, IFRAME, IMG, ILAYER, INPUT, KEYGEN, LABEL, LAYER, MAP, OBJECT, SCRIPT, SELECT, SPACER, TEXTAREA, WBR
Can Be Inside: Unspecified, probably: BLOCKQUOTE, BODY, CENTER, DD, DIV, FIELDSET, FORM, LI, MULTICOL, NOEMBED, NOFRAMES, NOLAYER, NOSCRIPT, TD, TH, DEL, INS,
APPLET, BUTTON, IFRAME, ILAYER, LAYER, OBJECT
Attributes: none

When the Netscape programmers introduced the EMBED element, they realized that many browsers would be unable to process the element, or might not have a plugin capable of processing the embedded object or data type. Consequently, they introduced a second element, NOEMBED, to contain HTML markup to be used should the browser be unable to process EMBED. A browser that understands EMBED and that can process the referenced data will display the EMBEDded object and will hide the content of NOEMBED. On the other hand, a browser that does not understand EMBED will ignore the EMBED and NOEMBED tags, and will treat the content of the NOEMBED element as HTML markup to be displayed with the document.

NOEMBED should be placed just after the associated EMBED—for example:

<EMBED SRC=“screaming-penguins.au” HEIGHT=“100” WIDTH=“200”>

<NOEMBED>
   <H3> The Sound of The Screaming Penguins</H3>
   <P>If you are reading this text, then your browser does not 
    support EMBED, and is unable to play the embedded audio 
    snippet. You are missing the exciting musical texturings 
    of the new jazz quintet <EM>The Screaming Penguins</EM>. 
   You can pick up their debut album at a record store near you.

</NOEMBED>

Recall that EMBED will soon be replaced by OBJECT. OBJECT provides much better mechanisms for embedding arbitrary data or program objects, plus better mechanisms for providing alternative HTML content for browsers that do not support the specified object.

SERVER Element: Server-Side JavaScript (Netscape Navigator Only)

Usage: <SERVER> ... </SERVER>
Can Contain: characters (JavaScript code)
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, MULTICOL, NOEMBED, NOFRAMES, NOLAYER, NOSCRIPT, P, PRE, TD, TH,
character highlighting, A, APPLET, BUTTON, IFRAME, ILAYER, LAYER, LABEL, LEGEND, OBJECT
Attributes: ALIGN, HEIGHT, SIZE, TYPE, WIDTH

SERVER is a container for JavaScript code to be executed on the Web server, prior to sending the document to a browser—at present, this is only supported by Netscape servers. Netscape servers support a special server-side JavaScript package, called LiveWire, which consists of a JavaScript interpreter, plus a special set of JavaScript functions designed for server-side processing, such as database querying. SERVER element content is processed before a document is sent to a browser, and the enclosed code (plus the <SERVER> and </SERVER> tags) are removed from the document before it is sent. Thus, a user should never see SERVER elements in served documents.

SPACER Element: Horizontal and Vertical Spacing (Netscape Navigator Only)

Usage: <SPACER>
Can Contain: empty
Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, MULTICOL, NOEMBED, NOFRAMES, NOLAYER, NOSCRIPT, P, PRE, TD, TH
character highlighting, A, APPLET, BUTTON, IFRAME, ILAYER, LAYER, LABEL, LEGEND, OBJECT
Attributes: ALIGN, HEIGHT, SIZE, TYPE, WIDTH

SPACER introduces arbitrary horizontal or vertical spacing within typed text. TYPE=“block” spacing is analogous to inserting a transparent (invisible) image of size HEIGHT and WIDTH, and allows insertion of horizontal and vertical space at the same place. TYPE=“horizontal” spacers introduce simple horizontal tab-like spacings of length specified by SIZE. TYPE=“vertical” introduces a vertical tab, again with size specified by SIZE. In this case, however, the tab also implies a line break.

Some examples of SPACER are shown in Figures 7.12 through 7.14. Note in particular Figure 7.14, which shows the page as displayed by a browser that does not understand SPACER. Because SPACER so strongly affects formatting, pages that depend on SPACER can be almost unreadable by browsers that do not understand this element.


Tip: Use Fully Transparent Images Instead of SPACER

A fully transparent image can be used to create indents similar to SPACER, but in a way that is better understood on a wide range of browsers. Simply create a fully transparent (blank) GIF image of some small size, for example 1-by-1 pixel. Then use IMG elements to create spacers of any size, simply by using the HEIGHT and WIDTH attributes to reshape the image. For example, to create a horizontal spacer 60 pixels long, use the tag

<IMG SRC="blank.gif" HEIGHT="1" WIDTH="60">

which shrinks the image to be 1 pixel high and 60 pixels wide.


The allowed SPACER attributes are:

ALIGN=“top,” “middle,” “bottom,” “left,” “right” (mandatory: TYPE=“block” only) Specifies the page alignment for the spacer, relevant for TYPE=“block” spacers only. Such spacers are treated in the same manner as images, so that the alignment options have the same meanings as for the IMG element.
HEIGHT=“number” (mandatory with TYPE=“block”) Specifies the height, in pixels, of the spacer. This is relevant only for TYPE=“block,” and should not be specified for other TYPEs.
SIZE=“number” (mandatory with TYPE=“horizontal” or “vertical”) Indicates the horizontal or vertical width of the spacer, in pixels: this attribute relevant only for TYPE=“horizontal” or “vertical” spacers. The effect is similar to a horizontal or vertical tab. This is relevant only for TYPE=“horizontal” and TYPE=“vertical,” and should not be specified for TYPE=“block.”
TYPE=“block,” “horizontal,” “vertical” (mandatory)Specifies the type of the spacer. A “block” spacer is analogous to an invisible image—you must also specify the HEIGHT, WIDTH, and desired ALIGNment of this type of spacer. TYPE=“horizontal” or TYPE=“vertical” are analogous to tabs—in these cases, the only required attribute is SIZE, which specifies the tab size. Note that a “vertical” spacer also introduces a line break (BR).
WIDTH=“number” (mandatory with TYPE=“block”) Specifies the width, in pixels, of the spacer. This is relevant only for TYPE=“block,” and should not be specified for other TYPEs.


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.