【小技巧】div层的重叠,不是防止,而是专门做的重叠

<HTML>
<HEAD>
<STYLE type="text/css">
<!--
.over 
       
{
       position
: absolute;
        top
: 165px;
        left
: 20px;
        z-index
: 2;
        background-color
: green
        
}

.under 
        
{
        position
: absolute;
        top
: 175px;
        left
: 20px;
        z-index
: 1;
        background-color
: blue
        
}
-->
</STYLE>
</HEAD>

<BODY>

<SPAN class="over">這段文字距離視窗左邊 20 點,上邊 165 點</SPAN> 
<SPAN class="under"> 這段文字則是接在前一段文字之"下"注意到有些字被遮住了, 我們也可以改變讓這段文字壓在前一段文字之上, 技巧在於改變 z-index 的值</SPAN> 
</BODY> 
</HTML> 
posted @ 2009-03-21 15:57  海洋——海纳百川,有容乃大.  阅读(446)  评论(0编辑  收藏  举报