【小技巧】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>
<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>