
Side Menu Hover Animation
Before We Start to Side Menu Hover Animation
Side Menu Hover Animation can be used to animate a Icons, Buttons, etc. and create user attractive UI components.
So if you are a person who wishes to develop a website, you have to know how to create animations properly. Check out our tutorial and you can learn this techniques and use it on your web development. Below sections shows how to develop this animations.
How to create? We are here to solve your problem. In this article we discuss how to create a hover effect animations. Before we start please read the below articles which easier you to understand the process, if you are new to development.
Step 1 – Add HTML
It’s too easy and simple. Just copy and paste below code in your HTML editor between <body> </body> tag as below.
<body>
<nav class="main-menu">
<div class="scrollbar" id="style-1">
<ul class="py-2">
<li class="py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-home fa-lg"></i>
<span class="nav-text">Home</span>
</div>
</a>
</li>
<li class="py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-user fa-lg"></i>
<span class="nav-text">Login</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-desktop fa-lg"></i>
<span class="nav-text">Technology</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-plane fa-lg"></i>
<span class="nav-text">Travel</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-shopping-cart"></i>
<span class="nav-text">Shopping</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-microphone fa-lg"></i>
<span class="nav-text">Film & Music</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-flask fa-lg"></i>
<span class="nav-text">Web Tools</span>
</div>
</a>
</li>
<li class="darkerli py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-align-left fa-lg"></i>
<span class="nav-text">Magazines</span>
</div>
</a>
</li>
<li class="darkerli">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-gamepad fa-lg"></i>
<span class="nav-text">Games</span>
</div>
</a>
</li>
<li class="darkerlishadowdown py-1">
<a href="javascript:void(0)">
<div class="py-1">
<i class="fa fa-rocket fa-lg"></i>
<span class="nav-text">Fun</span>
</div>
</a>
</li>
</ul>
<ul class="logout">
<li class="py-1">
<a href="javascript:void(0)">
<div>
<i class="fa fa-question-circle fa-lg"></i>
<span class="nav-text">Help</span>
</div>
</a>
</li>
</ul>
</div>
</nav>
</body>
Step 2 – Add CSS
We use some external CSS link to this code. No need to worry about this, copy and paste below code in between <head></head> tag.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" crossorigin="anonymous"/>
Copy and paste below code in your HTML editor between <style></style> tag as below.
<style>
body {
margin: 0px;
padding: 0px;
color: #fff;
font-weight: 300;
background-color: #1e4b23;
}
.settings {
height: 73px;
float: left;
background: #000;
background-repeat: no-repeat;
width: 250px;
margin: 0px;
text-align: center;
font-size: 20px;
font-family: 'Strait', sans-serif;
}
/* ScrolBar */
.scrollbar {
height: 90%;
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
}
.scrollbar:hover {
height: 90%;
width: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
/* Scrollbar Style */
#style-1::-webkit-scrollbar-track {
border-radius: 2px;
}
#style-1::-webkit-scrollbar {
width: 5px;
background-color: #F7F7F7;
}
#style-1::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
background-color: #BFBFBF;
}
/* Scrollbar End */
.fa-lg {
font-size: 1em;
}
.fa {
position: relative;
display: table-cell;
width: 55px;
height: 36px;
text-align: center;
top: 12px;
font-size: 20px;
}
.main-menu:hover,
nav.main-menu.expanded {
width: 250px;
overflow: hidden;
opacity: 1;
}
.main-menu {
background: #F7F7F7;
position: absolute;
top: 0;
bottom: 0;
height: 100%;
left: 0;
width: 55px;
overflow: hidden;
-webkit-transition: width .2s linear;
transition: width .2s linear;
-webkit-transform: translateZ(0) scale(1, 1);
box-shadow: 1px 0 15px rgba(0, 0, 0, 0.07);
opacity: 1;
}
.main-menu>ul {
margin: 7px 0;
}
.main-menu li {
position: relative;
display: block;
width: 250px;
}
.main-menu li>a {
position: relative;
width: 255px;
display: table;
border-collapse: collapse;
border-spacing: 0;
color: #1d350c;
font-size: 13px;
text-decoration: none;
-webkit-transform: translateZ(0) scale(1, 1);
-webkit-transition: all .14s linear;
transition: all .14s linear;
font-family: 'Strait', sans-serif;
text-shadow: 1px 1px 1px #fff;
}
.main-menu .nav-icon {
position: relative;
display: table-cell;
width: 55px;
height: 36px;
text-align: center;
vertical-align: middle;
font-size: 18px;
}
.main-menu .nav-text {
position: relative;
display: table-cell;
vertical-align: middle;
width: 190px;
font-family: 'Titillium Web', sans-serif;
}
.main-menu .fb-like {
left: 180px;
position: absolute;
top: 15px;
}
.main-menu>ul.logout {
position: absolute;
left: 0;
bottom: 0;
}
.no-touch .scrollable.hover {
overflow-y: hidden;
}
.no-touch .scrollable.hover:hover {
overflow-y: auto;
overflow: visible;
}
/* Logo Hover Property */
.settings:hover,
settings:focus {
background: url(https://s17.postimg.org/74cl7s05b/logo_hover.jpg);
-webkit-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
-moz-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
-o-transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
transition: all 0.2s ease-in-out, width 0, height 0, top 0, left 0;
}
.settings:active,
settings:focus {
background: url(https://s3.postimg.org/bqfooag4z/startific.jpg);
-webkit-transition: all 0.1s ease-in-out, width 0, height 0, top 0, left 0;
-moz-transition: all 0.1s ease-in-out, width 0, height 0, top 0, left 0;
-o-transition: all 0.1s ease-in-out, width 0, height 0, top 0, left 0;
transition: all 0.1s ease-in-out, width 0, height 0, top 0, left 0;
}
a:hover,
a:focus {
text-decoration: none;
border-left: 0px solid #F7F7F7;
}
nav {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
nav ul,
nav li {
outline: 0;
margin: 0;
padding: 0;
text-transform: uppercase;
}
/* Darker element side menu Start*/
.darkerli {
background-color: #ededed;
text-transform: capitalize;
}
.darkerlishadow {
background-color: #ededed;
text-transform: capitalize;
-webkit-box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.55);
-moz-box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.55);
box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.55);
}
.darkerlishadowdown {
background-color: #ededed;
text-transform: capitalize;
-webkit-box-shadow: inset 0px -4px 5px -4px rgba(50, 50, 50, 0.55);
-moz-box-shadow: inset 0px -4px 5px -4px rgba(50, 50, 50, 0.55);
box-shadow: inset 0px -4px 5px -4px rgba(50, 50, 50, 0.55);
}
/* Darker element side menu End*/
.main-menu li:hover>a,
nav.main-menu li.active>a,
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus,
.dropdown-menu>.active>a,
.dropdown-menu>.active>a:hover,
.dropdown-menu>.active>a:focus,
.no-touch .dashboard-page nav.dashboard-menu ul li:hover a,
.dashboard-page nav.dashboard-menu ul li.active a {
color: #fff;
background-color: #92b98f;
text-shadow: 0px 0px 0px;
}
.area {
float: left;
background: #e2e2e2;
width: 100%;
height: 100%;
}
</style>
At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want. Enjoy it.
Out Put


Video Tutorial
Please watch this video to better understand this tutorial and don’t forget to subscribe to our channel.
Help others to find out about this article on Social Media sites. If you have any doubt or any problem, don’t hesitate to contact us. Thereafter we will be able to help you and also make sure you bookmark our site on your browser.