spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column3


The HTML Container

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

It's time to create the data insertion point in the document. We need to define the exact position of our banner, so we'll use a <SPAN>...</SPAN> definition.

Navigator 4.0x can only write HTML code to a positioned element (position: absolute) so our element must be positioned. However, since we want to place it in the document's flow, we won't specify any positioning properties (left and top):

<SPAN ID="banner" STYLE="position: absolute;"></SPAN>

If you want to specify the banner's exact coordinates in relation to the browser window, simply install the left and top properties:

<SPAN ID="banner" STYLE="position: absolute; left: 100; -->
top: 300;"></SPAN>

We promised to create a backward-compatible script. If you want older browsers to display the banner's first frame, put the desired text (or any code) in the <SPAN>...</SPAN> definition. If you don't want a static banner on older browsers, you should keep the <SPAN>...</SPAN> definition empty.

Regardless of how you decide to include the element in the document, it should be followed by two <BR> tags. Since it is a positioned element (despite the fact that it has no explicit left and top definitions), content placed after the banner does not account for its space. Therefore, two <BR> tags are required.

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: September 25, 1997
Revised: April 16, 1998

URL: http://www.webreference.com/js/column3/styles.html