• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Page Layout > Positioning Elements with Layers

Positioning Elements with Layers

Although they had already promised to work towards a universal standard for HTML, Netscape developed a set of proprietary tags for positioning HTML elements in early 1997. Because Netscape has yet to completely support the official method for positioning elements (see pages 274–277), you may be forced to rely on layers (and perhaps a JavaScript program that determines which browser is being used) to position objects in Netscape browsers.

To position elements with layers:

1.
Type < LAYER.

2.
If desired, typeID=name, where name identifies the layer to JavaScript programs.

3.
TypeTOP=m, where m is the number of pixels the layer's contents should be offset from the top edge of the browser window.

4.
TypeLEFT=n, where n is the number of pixels the layer's contents should be offset from the left edge of the browser window.

5.
If desired, typeWIDTH=w, where w is the width of the layer in pixels.

6.
If desired, typeHEIGHT=h, where h is the height of the layer in pixels.

7.
If desired, typeSRC="source.html", where source.html is the initial HTML content that should appear in the layer (Figure 6.47).

8.
If desired, typeCLIP="t,l,r,b" where t, l, r, and b are the offsets in pixels from the top, left, right, and bottom.

Figure 6.44. Each layer is defined separately with its own coordinates. I've just entered plain text as the contents of each layer, but you can add any other HTML tags you like, except frames.


Figure 6.45. There are four layers in this example. Layers become really useful when combined with JavaScript.


9.
If desired, typeZ-INDEX=z, where z is a number indicating the layer's level if it overlaps other layers. The higher the value of z, the higher the layer.

10.
If desired, typeBGCOLOR=color, where color is one of the predefined colors listed on page 357.

11.
If desired, typeBACKGROUND="image.gif", where image.gif is the image that you'd like to use for the background of the layer.

12.
Type >.

13.
Create the contents of the layer.

14.
Type </LAYER>.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint