<LAYER> Tag & its Attribute

HTML Tag <LAYER>

<LAYER> Defines a layer within a document, which you can than manipulate with JavaScript. Specify the layer’s contents by placing HTML between the <LAYER> tags or by using the SRC= attribute.

Attribute of <LAYER> Tag

ABOVE

Specifies the name of a layer above which the current layer should appear.

<LAYER SRC="grass.gif" Z-INDEX=1
NAME="Grass" VISIBILITY=SHOW>
<LAYER SRC="tree.gif" ABOVE="Grass"
NAME="Tree">


Possible Values

Layer Name



BACKGROUND

Specifies the relative or absolute location of an image file that the browser tiles as the background of the layer.

<LAYER Z-INDEX=5 NAME="info"
BACKGROUND="logo.gif">
<H1>Hi there</H1></LAYER>


Possible Values

URL



BELOW

Specifies the name of a layer below which the current layer should appear.

<LAYER BACKGROUND="road.jpg"
NAME="Road" UNDER="Car">
</LAYER>


Possible Values

Layer Name



BGCOLOR

Specifies the background color of the layer. Use either the hexadecimal RGB values or the color name.

<LAYER BGCOLOR=#FF0011>
<DIV ALIGN=CENTER>
<H1><BLINK>EAT AT JOES!</BLINK></H1>
</DIV>
</LAYER>


Possible Values

Color Name or hexadecimal Color Code.



CLIP

Indicates the dimensions of a clipping rectangle that specifies which areas of the layer are visible. Areas outside this rectangle become transparent.

<LAYER SRC="hawk.jpg" CLIP="20%,20%">
</LAYER>


Possible Values

Value in percentage.



HEIGHT

Specifies the vertical dimension of the layer (in pixels or as a percentage of the browser window height).

<LAYER SRC="frame.gif" ABOVE="bg"
NAME="frame" WIDTH=200 HEIGHT=200>


Possible Values

Value in Pixel



LEFT

Specifies the layer’s horizontal position (in pixels) relative to the left edge of the parent layer. Use the TOP= attribute for vertical positioning.

<LAYER LEFT=100 TOP=150>
This layer is at {100,150}
</LAYER>


Possible Values

Integer Value.



NAME

Gives the layer a name by which other layer definitions and JavaScript code can reference it.

<LAYER SRC="car.gif" NAME="CarPic"
ABOVE="Road">
</LAYER>


Possible Values

Any Name.



SRC

Specifies the relative or absolute location of the file containing the contents of the layer.

<LAYER SRC="logo.jpg"></LAYER>


Possible Values

URL



TOP

Specifies the layer's vertical position (in pixels) relative to the top edge of the parent layer. Use the LEFT= attribute for horizontal positioning.

<LAYER LEFT=100 TOP=150>
This layer is at {100,150}
</LAYER>


Possible Values

Any Integer Number.



VISIBILITY

Indicates whether the layer is initially visible. VISIBILITY=SHOW indicates the layer is initially visible. VISIBILITY=HIDE indicates the layer is not initially visible.

<LAYER SRC="grass.gif" Z-INDEX=1
NAME="Grass" VISIBILITY=SHOW>


Possible Values

SHOW, HIDE, INHERIT



WIDTH

Specifies the horizontal dimension of the layer (in pixels or as a percentage of the browser window width).

<LAYER SRC="frame.gif" ABOVE="bg"
NAME="frame" WIDTH=200 HEIGHT=200>


Possible Values

Any Integer Number.



Z-INDEX

Specifies where the layer appears in the stack of layers. Higher values indicate a position closer to the top of the stack.

<LAYER Z-INDEX=0 NAME="Bottom">
You may never see this text if
other layers are above it.
</LAYER>


Possible Values

Any Integer Number.




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz