Z-index Css

Z-Index merupakan penempatan layer pada css, contoh:


HTML (index.html)

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style>
.layer1{position:relative;
z-index:1;
top:0;
left:0;
background:#ff0000;
width:100px;
height:100px;
}
.layer2{
position:absolute;
z-index:0;
top:50px;
left:50px;
background:#eeeeee;
width:100px;
height:100px;

}
</style>
<body>
<div class="layer1"></div>
<div class="layer2"></div>
</body>
</html>

Demo :






Tidak ada komentar:

Posting Komentar

Leave a message