The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <LABEL> | Next Tag: <LEGEND> |


<LAYER>

Creates a layer, which is a separate object that can contain text, images, or even another page, and which can be positioned precisely on the page, even to the point of overlapping other inline layers.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later
Notes:
  • Unlike an inline layer created with the <ILAYER> tag, a regular layer can be positioned anywhere on the page and isn't part of the regular flow of the page.
  • The order that layers are stacked upon each other is called the z-order.
  • This tag requires the </LAYER> end tag.
Attributes:
ABOVE = "Text"
The name of the layer that will be positioned directly above the current layer in the z-order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

BACKGROUND = "Text"
A filename or URL for an image upon which the layer's text and images will appear.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

BELOW = "Text"
The name of the layer that will be positioned directly below the current layer in the z-order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

BGCOLOR = "Color value"
The color to use for the layer background.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Use either an RGB value or a color name.
  • Try to use a color that's compatible with the color you're using for your page text.

CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

CLIP = "Postive integers"
The coordinates of the layer's viewable area.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Use the following format:

    CLIP="left,top,right,bottom"

    The various values are positive integers. You can also use only the right and bottom values and the left and top default to 0.

HEIGHT = Positive integer
The layer's height, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LEFT = Postive integer
The position of the left side of the layer. If the current layer is part of another layer—called the parent layer—then the position is relative to the parent layer.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

NAME = "Text"
The name of the layer.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • The NAME attribute enables other layers to be positioned relative to the current layer in the z-order (see the ABOVE and BELOW attributes).

PAGEX = Postive integer
The position of the left side of the layer relative to the browser window.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

PAGEY = Postive integer
The position of the top of the layer relative to the browser window.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

SRC = "Text"
The URL of a page that will appear inside the layer.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Use either just a file name (if the sound file is in the same directory as the page), a relative name (if the sound file is in another directory), or a full URL.

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

TOP = Postive integer
The position of the top of the layer. If the current layer is part of another layer—called the parent layer—then the position is relative to the parent layer.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

VISIBILITY = "Text"
Determines whether the layer is visible.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Possible values: SHOW, HIDE, INHERIT. (The latter means that the inline layer takes the same VISIBILITY value as its parent layer.)

WIDTH = Positive integer
The layer's width, in pixels.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Z-INDEX = Postive integer (or 0)
The layer's position within the z-order.

Support:

HTML StandardInternet ExplorerNetscape Navigator
Not supported Not supported 4.0 and later

Notes:

  • Layers with higher Z-INDEX values are positioned above layers with lower Z-INDEX values.

Example:
<LAYER LEFT=5 TOP=0 Z-INDEX=1><FONT SIZE=5 COLOR="#FF0000">RED</FONT></LAYER>
<LAYER LEFT=20 TOP=10 Z-INDEX=2><FONT SIZE=5 COLOR="#0000FF">BLUE</FONT></LAYER>
<LAYER LEFT=50 TOP=15 Z-INDEX=3><FONT SIZE=5 COLOR="#00FF00">GREEN</FONT></LAYER>
How It Looks:
Follow this link in Netscape 4.0 or later to see the result.

| Index | Previous Tag: <LABEL> | Next Tag: <LEGEND> |