POSITIONING PROPERTIES

NCD Style Sheet Guide v5.0

!!! Netscape can't display "Cascading Positioning" correctly.
So some images will appear in unexpected places. !!!

+ Box Positioning

Box Positioning {position: # }
    #=absolute     depends on the parent coordinate system.
    #=relative     depends on the default flow of the document.
    #=static     default positioning

Specify Left Position {left: # }
Specify Top Position {top: # }
Specify Right Position {right: # }
Specify Bottom Position {bottom: # }
    #=length (px, pt, in, cm, em), %, auto


Absolute Positioning

<DIV STYLE="position:absolute; left:0; top:0">
Today is fine.
</DIV>
<DIV STYLE="position:absolute; right:0; bottom:0">
Tomorrow will be fine.
</DIV>
Show Result

Relative Positioning

<DIV STYLE="position:relative; left:0; top:0">
Today is fine.
</DIV>
Show Result


Cascading Positioning

<DIV STYLE="position:relative; left:0; top:0; height:100; width:100;
 border-style:solid">
Today is fine.<BR>
<IMG SRC="heno01.gif" STYLE="position: #; left:#; top:#">
Tomorrow will be fine.<BR>
</DIV>
position:ablolute;
left:0; top:0
Today is fine.
Tomorrow will be fine.
position:relative;
left:0; top:0
Today is fine.
Tomorrow will be fine.
position:ablolute;
left:20; top:20
Today is fine.
Tomorrow will be fine.
position:relative;
left:20; top:20
Today is fine.
Tomorrow will be fine.



+ Clipping

{clip: rect(#top #right #bottom #left) }
    #=length (px, pt, in, cm, em), auto

<DIV STYLE="position:relative; left:0; top:0; 
 width:100; background:yellow">
<IMG SRC="heno01.gif" STYLE="position:absolute; clip:#">
</DIV>
clip:auto                                  clip:rect(0 30 30 0)
Today is fine.
Tomorrow will be fine.
Today is fine.
Tomorrow will be fine.



+ Overflow

{overflow: # }     #=visible, hidden, scroll, auto

<DIV STYLE="height:100; width:100; border-style:solid; overflow:#">
Today is fine....Today is fine.
</DIV>
visible hidden scroll auto
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.


{overflow-x: # }
{overflow-y: # }     #=visible, hidden, scroll, auto

<DIV STYLE="height:100; width:100;
 border:solid; overflow-x:scroll">
<NOBR>Today is fine....</NOBR>
</DIV>
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.
<DIV STYLE="height:100; width:100;
 border:solid; overflow-y:scroll">
Today is fine....
</DIV>
Today is fine. Today is fine. Today is fine. Today is fine. Today is fine.


+ Z-Index Ordering

{z-index: # }     #=integer, auto

<DIV STYLE="position:relative; left:0; top:0;
 height:100; width:100; border-style:solid">
Today is fine.<BR>
Tomorrow will be fine.<BR>
<IMG SRC="heno01.gif" STYLE="position:absolute;
 left:0; top:0; z-index:#">
</DIV>

{z-index:auto}

Today is fine.
Tomorrow will be fine.

{z-index:-1}

Today is fine.
Tomorrow will be fine.


+ Visibility

{visibility: # }     #=visible, hidden, inherit

HELLO
<DIV STYLE="position:relative; left:0; top:0;
 height:100; width:100; border-style:solid; visibility:#">
Today is fine.<BR>
Tomorrow will be fine.<BR>
</DIV>
BYE

{visibility:visible}
This is default.

HELLO
Today is fine.
Tomorrow will be fine.
BYE

{visibility:hidden}

HELLO
Today is fine.
Tomorrow will be fine.
BYE


+ Display

{display: # }     #=none

HELLO
<DIV STYLE="width:100; border-style:solid; display:#">
Today is fine.<BR>
Tomorrow will be fine.<BR>
</DIV>
BYE

{display:block}
This is default.

HELLO
Today is fine.
Tomorrow will be fine.
BYE

{display:none}

HELLO
Today is fine.
Tomorrow will be fine.
BYE


{display: # }     #=block, inline, list-item

<SPAN STYLE="display:block">
Hello.
</SPAN>
Today is fine.
Hello. Today is fine.
<DIV STYLE="display:inline">
Hello.
</DIV>
Today is fine.
Hello.
Today is fine.
<DIV STYLE="display:list-item">
Hello.
</DIV>
Today is fine.
Hello.
Today is fine.

Style Sheet Guide | HTML Design Guide
Basic | Selector | Cascading | Font | Text | List | Color & Background |
Box | Box Positioning | Other|
Style Property LIST


BACK TO NCD HOME
Network Communication Design - http://www.ncdesign.org/
Copyright & Publishing 1994-1999 Yuriko Ienaga yuri@ncdesign.org