<div class="title">Dropdown Menu Effects</div>
<div class="main">
<input type="checkbox" id="drop-1" hidden>
<label class="dropHeader dropHeader-1" for="drop-1">Click Me</label>
<div class="list list-1">
<div class="item">Option one</div>
<div class="item">Option two</div>
<div class="item">Option three</div>
<div class="item">Option four</div>
</div>
</div>
<div class="main">
<input type="checkbox" id="drop-2" hidden>
<label class="dropHeader dropHeader-2" for="drop-2">Click Me</label>
<div class="list list-2">
<div class="item">Option one</div>
<div class="item">Option two</div>
<div class="item">Option three</div>
<div class="item">Option four</div>
</div>
</div>
<div class="main">
<input type="checkbox" id="drop-3" hidden>
<label class="dropHeader dropHeader-3" for="drop-3">Click Me</label>
<div class="list list-3">
<div class="item">Option one</div>
<div class="item">Option two</div>
<div class="item">Option three</div>
<div class="item">Option four</div>
</div>
</div>
<div class="main">
<input type="checkbox" id="drop-4" hidden>
<label class="dropHeader dropHeader-4" for="drop-4">Click Me</label>
<div class="list list-4">
<div class="item">Option one</div>
<div class="item">Option two</div>
<div class="item">Option three</div>
<div class="item">Option four</div>
</div>
</div>
<div class="main">
<input type="checkbox" id="drop-5" hidden>
<label class="dropHeader dropHeader-5" for="drop-5">Click Me</label>
<div class="list list-5">
<div class="item">Option one</div>
<div class="item">Option two</div>
<div class="item">Option three</div>
<div class="item">Option four</div>
</div>
</div>
@import 'https://fonts.googleapis.com/css?family=Raleway:400,700';
* {
box-sizing: border-box;
color: #34495e;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family: 'Raleway', sans-serif;
}
html, body {
padding: 0px;
margin: 0px;
background-color: #2980b9;
text-align: center;
}
.title {
text-align: center;
font-size: 44px;
padding: 50px;
color: #fff;
}
.main {
display: inline-block;
margin: 30px;
position: relative;
width: 150px;
text-align: left;
}
label {
width: 100%;
position: absolute;
line-height: 45px;
top: 0px;
left: 0px;
background-color: #fff;
padding-left: 20px;
font-weight: 700;
-webkit-transition: 0.04s ease-in-out;
transition: 0.04s ease-in-out;
}
.list {
width: 100%;
position: absolute;
z-index: 1;
top: 45px;
left: 0px;
border-top: 1px solid #eee;
visibility: hidden;
opacity: 0;
cursor: pointer;
-webkit-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
}
.item {
width: 100%;
line-height: 45px;
padding-left: 20px;
background-color: #fff;
-webkit-transition: 0.2s ease-in-out;
transition: 0.2s ease-in-out;
font-weight: 400;
}
.item:hover {
background-color: #eee;
}
/**********
***********/
#drop-1:checked~ .list-1 {
visibility: visible;
opacity: 2;
z-index: 10;
}
/**********
***********/
#drop-2:checked~ .list-2 {
visibility: visible;
opacity: 2;
z-index: 10;
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
#drop-2:checked~ .dropHeader-2 {
-webkit-transform: scale(0.9);
transform: scale(0.9);
}
/**********
***********/
.list-3 {
-webkit-transform: translateY(20px);
transform: translateY(20px);
z-index: 10;
}
#drop-3:checked~ .list-3 {
visibility: visible;
opacity: 2;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
/**********
***********/
.list-4 {
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
z-index: 10;
}
#drop-4:checked~ .list-4 {
visibility: visible;
opacity: 2;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
/**********
***********/
.list-5 {
-webkit-transform: translateX(-20px);
transform: translateX(-20px);
z-index: 10;
}
#drop-5:checked~ .list-5 {
visibility: visible;
opacity: 2;
}
#drop-5:checked~ .list-5 {
-webkit-transform: translateX(0px);
transform: translateX(0px);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.