[HTML5教學]z-index(第六堂課)

三個元素透過 z-index 重疊範例
.div01 {
width:200px;
height:200px;
background-color:#FFA0A2;
z-index:1;
top:10px;
left:10px;
position:absolute;
}
.div02 {
width:200px;
height:200px;
background-color:#57FBE4;
z-index:2;
top:30px;
left:30px;
position:absolute;
}
.div03 {
width:200px;
height:200px;
background-color:#FFEB3D;
z-index:3;
top:50px;
left:50px;
position:absolute;
}
HTML語法
<div class="div01"></div>
<div class="div02"></div>
<div class="div03"></div>

0 個評論

要回覆文章請先登入註冊