HTML and CSS Reference
In-Depth Information
rent layer, as we demonstrate later in this appendix, or to modify your
layer using JavaScript, you'll need to name your layers using the
name
attribute. The value you give
name
is a text string, whose first character
must be a letter, not a number or symbol.
Once you name the layer, you can refer to it elsewhere in the document
and change it while the user interacts with your page. For example, this
bit of HTML:
<layer name="warning" visibility=hide>
Warning! Your input parameters were not valid!
</layer>
creates a layer named
warning
that is initially hidden. If in the course of
validating a form using a JavaScript routine, you find an error and want
to display the warning, you would use this command:
warning.visibility = "show";
Netscape 4 then makes the layer visible to the user.
H.3.1.2. The left and top attributes
Without attributes, a layer gets placed in the document window as
though it were part of the normal document flow. Layers at the very be-
ginning of a document get put at the top of the Netscape 4 window; lay-
ers that are between conventional document content get placed in line
with that content.
The power of layers, however, is that you can place them anywhere in
the document. Use the
top
and
left
attributes for the
<layer>
tag to
specify its absolute position in the document display.