Positioning of Elements

Only Block-Level elements (those that create a line break like P, H1 - H6, DIV, BLOCKQUOTE) and the Netscape-unique LAYER can be positioned. Obviously inline elements should STAY inline!

The STYLE for a positioned block-level element MUST specify the position property, (according to Netscape) which may be:

absolute = the element is fixed to that spot on the page or layer containing it.

relative = the element will move with the flow of text, should the formatting change.

static = the element will not scroll with the page but stays in one spot on the screen

The browsers do not support all of the planned applications of positioning yet.


Syntax:

for embedded or linked stylesheet -

    .myspot {position:absolute;left:100px;top:75px}

for inline styling-

    <div style="position:absolute;left:100px;top:75px">

for a layer the position can be set in the tag and the position will be absolute-

   <LAYER LEFT=100 TOP=300>


Examples:
    Absolute Position
    Relative Position
    Static Position


© 1997-2002 Jan Smith   <jegs1@jegsworks.com>