<input type="checkbox" id="cp_navimenuid">
<label class="menu" for="cp_navimenuid">
<div class="menubar">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
<ul>
<li><a id="home" href="#home">Home</a></li>
<li><a id="about" href="#about">About</a></li>
<li><a id="contact" href="#contact">Contact</a></li>
</ul>
</label>
*, *:before, *:after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.menu {
display: block;
overflow: hidden;
width: 60px;
height: 60px;
margin: 30px auto;
cursor: pointer;
-webkit-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
border: 3px solid transparent;
border-radius: 50%;
background-color: #1b2538;
}
.menu div.menubar {
width: 30px;
margin: 17px auto;
}
.menu div.menubar .bar {
display: block;
width: 100%;
height: 5px;
margin-top: 3px;
border-radius: 2px;
background-color: #ffffff;
}
.menu ul {
display: none;
margin: 0;
padding: 0;
list-style-type: none;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
text-align: center;
opacity: 0;
}
.menu ul li {
display: inline-block;
}
.menu ul li a {
display: inline-block;
padding: 0.7em 0.5em;
-webkit-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
text-decoration: none;
color: #1b2538;
border-bottom: 4px solid transparent;
height: 56px;
line-height: 2em;
}
.menu ul li a:hover {
color: #ffffff;
background-color: #1b2538;
}
.menu ul li a:target {
border-bottom-color: #1b2538;
}
/* クリックした時の動き */
#cp_navimenuid {
display: none;
}
#cp_navimenuid:checked ~ .menu {
width: 100%;
height: 60px;
border: 3px solid #1b2538;
border-radius: 5px;
background-color: transparent;
}
#cp_navimenuid:checked ~ .menu > ul {
display: block;
opacity: 1;
}
#cp_navimenuid:checked ~ .menu > .menubar {
display: none;
}