Tuesday, September 30, 2014

CSS Folding Paper Like Menu.

<style type="text/css">

ul,li{
margin: 0;
padding: 0;
}

.main{
position:absolute;
z-index:1;
}

.main li{
list-style:none;
background: #9b59b6;
width:100px;
padding: 0 5px;
border: 1px solid black;
height: 30px;
line-height: 30px;
-webkit-transition: all .5s ease-in-out;
}

.main li:nth-child(odd){
-webkit-transform-origin: top;
-webkit-transform: perspective(350px) rotateX(-90deg);
}

.main li:nth-child(even){
margin-top:-65px;
-webkit-transform-origin: bottom;
-webkit-transform: perspective(350px) rotateX(90deg);
}

.hov:hover li:nth-child(odd){
-webkit-transform-origin: top;
-webkit-transform: perspective(30px) rotateX(0deg);
margin-top:0;
}

.hov:hover li:nth-child(even){
-webkit-transform-origin: bottom;
-webkit-transform: perspective(30px) rotateX(0deg);
margin-top:0;
}

.main li:first-child{
margin-top:0;
}

.hov{
position:relative;
height: 40px;
width:112px;
background: #2ecc71;
color: white;
font-size: 13px;
font-family: Helvetica;
font-weight:bold;
text-align: center;
line-height: 40px;
list-style:none;
z-index:2;
}

</style>

<nav>
<li class="hov">Hover Me!
<ul class="main">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
<li>Item4</li>
</ul>
</li>
</nav>


Output :)

1)

2)

No comments:

Post a Comment