Sidebar Menu using HTML & CSS
Legenddocx Creation represents you In this Video How to create Responsive Side menubar using HTML, CSS.
<html>
<head>
<title>Menu Bar</title>
</head>
<body>
<aside>
<h1>D.V.M Public School</h1>
<h4 style="color: #000">Location</h4>
<h3>NH-85, Chhapra Siwan Rd, Makhdum Sarai, Siwan</h3>
</aside>
<input type="checkbox" id="menu-toggle" />
<label id="trigger" for="menu-toggle"></label>
<label id="item-show" for="menu-toggle"></label>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Campus</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</body>
</html>
HTML
<head>
<title>Menu Bar</title>
</head>
<body>
<aside>
<h1>D.V.M Public School</h1>
<h4 style="color: #000">Location</h4>
<h3>NH-85, Chhapra Siwan Rd, Makhdum Sarai, Siwan</h3>
</aside>
<input type="checkbox" id="menu-toggle" />
<label id="trigger" for="menu-toggle"></label>
<label id="item-show" for="menu-toggle"></label>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Campus</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</body>
</html>
CSS
<style>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700);
@keyframes checked-anim {
50% {
width: 3000px;
height: 3000px;
}
100% {
width: 100%;
height: 100%;
border-radius: 0;
}
}
@keyframes not-checked-anim {
0% {
width: 3000px;
height: 3000px;
}
}
li,
a {
margin: 75px 0 -55px 0;
color: #03A9F4;
font: 14pt "Roboto", sans-serif;
font-weight: 700;
line-height: 1.8;
text-decoration: none;
text-transform: none;
list-style: none;
outline: 0;
display: none;
}
li {
width: 230px;
text-indent: 56px;
}
a:focus {
display: block;
color: #333;
background-color: #eee;
transition: all .5s;
}
aside {
position: absolute;
color: white;
top: 35%;
right: 10%;
text-align: right;
}
h1 {
line-height: 0;
font-size: 4vw;
font-weight: 700;
}
h3 {
float: right;
line-height: .3;
font-size: 2.5vw;
font-weight: lighter;
}
h4 {
float: left;
margin-left: -2%;
font-size: 1.5vw;
font-weight: lighter;
}
html,
body {
margin: 0;
padding: 0;
background-color: #03A9F4;
font-family: 'Roboto', sans-serif;
overflow: hidden;
}
#trigger,
#item-show,
#item-show:before,
#item-show:after {
position: absolute;
top: 25px;
left: 25px;
background: #03A9F4;
width: 30px;
height: 5px;
transition: .2s ease;
cursor: pointer;
z-index: 1;
}
#trigger {
height: 25px;
background: none;
}
#item-show:before {
content: " ";
top: 10px;
left: 0;
}
#item-show:after {
content: " ";
top: 20px;
left: 0;
}
#menu-toggle:checked+#trigger+#item-show {
top: 35px;
transform: rotate(180deg);
transition: transform .2s ease;
}
#menu-toggle:checked+#trigger+#item-show:before {
width: 20px;
top: -2px;
left: 18px;
transform: rotate(45deg) translateX(-5px);
transition: transform .2s ease;
}
#menu-toggle:checked+#trigger+#item-show:after {
width: 20px;
top: 2px;
left: 18px;
transform: rotate(-45deg) translateX(-5px);
transition: transform .2s ease;
}
#menu {
position: absolute;
margin: 0;
padding: 0;
width: 110px;
height: 110px;
background-color: #fff;
border-bottom-right-radius: 100%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
animation: not-checked-anim .2s both;
transition: .2s;
}
#menu-toggle:checked+#trigger+#item-show+#menu {
animation: checked-anim 1s ease both;
}
#menu-toggle:checked+#trigger~#menu>li,
a {
display: block;
}
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
display: none;
}
</style>
BEFORE
AFTER
Post a Comment