Animate font awesome icons compatible to twitter bootstrap css





You can using following CSS to animate font awesome icons compatible to twitter bootstrap.

.btn-animated {
    min-width: 0 !important;
    padding-right: 45px !important;
    position: relative;
}
.btn-animated.animate-to-right i {
    line-height: 34px;
    min-width: 12px;
    position: absolute;
     right: 17px;
    top: 0;
    transition: right 0.2s ease-in-out 0s;
    z-index: 3;
}
 
.btn-animated.animate-to-left i {
    line-height: 34px;
    min-width: 12px;
    position: absolute;
     right: 6px;
    top: 0;
    transition: right 0.2s ease-in-out 0s;
    z-index: 3;
}
 
.btn-animated::after {
    background-color: rgba(0, 0, 0, 0.1);
    content: "";
    height: 100%;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.2s ease-in-out 0s;
    width: 35px;
    z-index: 2;
}
.btn-animated.radius-50::after {
    border-radius: 0 25px 25px 0;
}
.btn-animated.btn-gray-transparent::after {
    background-color: rgba(0, 0, 0, 0.05);
}
.btn-animated:hover::after {
    opacity: 1;
}
.btn-animated.animate-to-right:hover i {
    right: 11px;
}
 
.btn-animated.animate-to-left:hover i {
    right: 14px;
}
.btn-animated.btn-sm {
    padding-right: 35px !important;
}
.btn-animated.btn-sm::after {
    width: 25px;
}
.btn-animated.btn-sm i {
    line-height: 28px;
    min-width: 11px;
    right: 14px;
}
.btn-animated.btn-sm:hover i {
    right: 7px;
}
.btn-animated.btn-lg {
    padding-right: 60px !important;
}
.btn-animated.btn-lg::after {
    width: 45px;
}
.btn-animated.btn-lg i {
    line-height: 48px;
    min-width: 15px;
    right: 25px;
}
.btn-animated.btn-lg:hover i {
    right: 15px;
}

How to use in HTML to animate to left

   <a class="btn btn-success btn-animated animate-to-left" href="#">Learn more  <i class="fa fa-arrow-left pl-10"></i></a>

How to use in HTML to animate to right

 
<a class="btn btn-success btn-animated animate-to-right" href="#">Learn more  <i class="fa fa-arrow-right pl-10"></i></a>



Tags:

Comments are closed.