Friday 6 July 2012

OVERLAPPING ELEMENTS

Overlapping Elements


When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:


Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

An element with greater stack order is always in front of an element with a lower stack order.
HINT: If two positioned elements overlap, without a z-index specified, the element positioned last in the HTML code will be shown on top.

No comments:

Post a Comment