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



Figure 7.12 Demonstration HTML document illustrating the MULTICOL, SPACER, NOBR, WBR, and MARQUEE elements. These elements do not work on all browsers.

<HTML>
<HEAD><TITLE>Common HTML Extensions</TITLE></HEAD>
<BODY>
<H2>Common HTML Extensions</H2>
<B><I><MARQUEE ALIGN=“middle” HSPACE=“10” LOOP=“-1” 
        SCROLLAMOUNT=“3” 
        SCROLLDELAY=“4”
        BGCOLOR=“yellow”>
 Look out -- Falling Aardvarks!!</I></B>
</MARQUEE></I></B><BR>

Here is some regular text -- note how the lines are 
broken to best fit the page. This is not an exciting
example but, as I have pointed out, the imagination 
starts to fade at around 3:00AM.

<HR WIDTH=“80%” ALIGN=“left”>
<NOBR>
Here is some regular text, but placed inside a <B>NOBR</B> 
so that lines are<WBR><EM>*wbr*</EM> not broken, except
at BR or WBR elements -- I have placed the string
<EM>*wbr*</EM> right after every ocurrence of an &lt;WBR> 
tag. This is rather  boring but, hey -- <WBR><EM>*wbr*</EM> 
whadaya want at these prices?</NOBR>
<HR NOSHADE SIZE=4>
<H3>MULTICOL Example</H3>
<MULTICOL COLS=2 GUTTER=15>
<P>There are three types of spacers, “block”, “horizontal”,
and “vertical”. The first exmaple is a block spacer, with a 
height of 40 pixels, a width of 60 pixels, and left-alignment.
Here it is -- 
<SPACER ALIGN=“left” WIDTH=“60” HEIGHT=“40” TYPE=“block”>
-- and there it was. Notice how it floats like an image, with
text flowing around it. Of course, a blank, fully transparent
image works just as well--and also works on other browsers.
<H3>Horizontal and Vertical</H3>
Horizontal spacers are like tabs: here is one of SIZE=40
(40 pixels long)--|
<SPACER TYPE=“horizontal” SIZE=“40”>|--
see how it tabs across. Vertical spacers moves text down
and also cause a line break. Here is an example
with a vertical spacing of 40 pixels.
--|<SPACER TYPE=“vertical” SIZE=“20”>|--there it was.
</MULTICOL>
</BODY>
</HTML>
HSPACE=“number” (optional)Specifies the margin, in pixels, to leave to the left and right of the MARQUEE. The default value is 0.
onBounce=“event-handling script” (optional; Internet Explorer 4 only)Specifies the script to run when the content of the MARQUEE has scrolled to one side, and switches to scroll in the opposite direction—valid only with BEHAVIOR=“alternate.”


Figure 7.13  Rendering, using Netscape Navigator 3, of the HTML document shown in Figure 7.12. This browser does not understand the MARQUEE element.

onFinish=“event-handling script” (optional; Internet Explorer 4 only) Specifies the script to run when the marquee content has finished scrolling.
onStart=“event-handling script” (optional; Internet Explorer 4 only) Specifies the script to run when the marquee starts scrolling, or when it finishes a scrolling pattern (such as a bounce) and restarts the same pattern.
LOOP=“number,” “infinite” (optional)Specifies the number of times the marquee will loop before stopping. The values LOOP=“-1” or LOOP=“infinite” cause the marquee to loop forever. The default is “-1.”
SCROLLAMOUNT=“number” (optional) Specifies the number of pixels between subsequent redraws of the marquee text—a large value yields a marquee that jumps rapidly across the screen, while a small value yields smoothly scrolled text.
SCROLLDELAY=“number” (optional)Specifies the time delay, in milliseconds, between subsequent redraws of the marquee text—a small value implies a rapidly scrolling marquee.
TRUESPEED (optional; Internet Explorer 4 only)Specifies that the scroll delay should be exactly the number specified in the SCROLLDELAY attribute. If absent, values less than 59 are rounded up to 60 (milliseconds).
VSPACE=“number” (optional)Specifies the margin, in pixels, to leave above and below the MARQUEE. The default value is 0.
WIDTH=“ number,”number%” (optional) Specifies the width of the marquee. This width can either be specified in pixels or as a percentage of the display window width. You should be careful not to make the MARQUEE too narrow, as the content may then be hard to read.


Figure 7.14  Rendering, using the Internet Explorer 3 browser, of the HTML document shown in Figure 7.12. This browser does not understand the MULTICOL and SPACER elements.

MULTICOL Element: Multicolumn Text (Netscape Navigator Only)

Usage: <MULTICOL> ... </MULTICOL>
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, ILAYER, IMG, 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,
Can Be Inside: APPLET, BUTTON, IFRAME, ILAYER, LAYER, OBJECT
Attributes: CLASS, ID, STYLE, COLS, GUTTER, WIDTH

MULTICOL specifies text to be displayed in multicolumn format. The attributes specify the number of columns to use and the spacing between columns. Almost any BODY element can appear inside MULTICOL, but some, such as BLOCKQUOTE, can lead to odd formatting due to the browser’s miscalculation of text lengths within the columns. Embedding images or objects within columnar text will also cause problems if the object is larger than the column width.

MULTICOL is allowed inside MULTICOL—but don’t get carried away or the text will look ridiculous!

An example of MULTICOL is shown in Figures 7.12 and 7.13. Figure 7.14 shows how this document looks when viewed by a browser that does not understand MULTICOL. The text is still easy to read, although only in one column.

COLS=“number” (mandatory)Specifies the number of columns to use. The default value is 1.
GUTTER=“number” (optional)Specifies the space to leave between the columns, in pixels. The default value is 10.
WIDTH=“number,”number%” (optional)Specifies the width for the collection of columns, including the gutter, either as an absolute width in pixels (number) or as a percentage of the available width (number%).

NOBR Element: No Line Break

Usage: <NOBR> ... </NOBR>
Can Contain: Unspecified, probably: characters, character highlighting, A, APPLET, BASEFONT, BR, BUTTON, EMBED, IFRAME, ILAYER, IMG, INPUT, KEYGEN, LABEL, LAYER, MAP, OBJECT, SPACER, SCRIPT, SELECT, TEXTAREA, WBR
Can Be Inside: Unspecified, probably: 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: CLASS, ID, STYLE, TITLE


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.