css中z-index与position属性的巧妙应用

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
</head>
<body>
    <div style="position:relative; width:150px; height:100px; z-index:2; background-color:Red;"></div>
    <div style="position:relative; width:150px; height:100px; z-index:1; top:-20px; background-color:Blue;"></div>
</body>
</html>