<div class="container">
<h1>CSS3 Button <span>Hover</span> Effects</h1>
<div class="button-effect">
<h2>Effect #1</h2>
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
<a class="effect effect-1" href="#" title="Learn More">Learn More</a>
</div>
<div class="button-effect">
<h2>Effect #2</h2>
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
<a class="effect effect-2" href="#" title="Learn More">Learn More</a>
</div>
<div class="button-effect">
<h2>Effect #3</h2>
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
<a class="effect effect-3" href="#" title="Learn More">Learn More</a>
</div>
<div class="button-effect">
<h2>Effect #4</h2>
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
<a class="effect effect-4" href="#" title="Learn More">Learn More</a>
</div>
<div class="button-effect">
<h2>Effect #5</h2>
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
<a class="effect effect-5" href="#" title="Learn More">Learn More</a>
</div>
</div>
$bg-color: #F1E9DA;
$link-text-color: #fff;
$button-bg-1: #541388;
$button-bg-2: #D90368;
$button-bg-3: #104547;
$button-bg-4: #4F000B;
$button-bg-5: #F28123;
$border-radius: 6px;
$overlay-color: #fff;
/* common styles !!!YOU DON'T NEED THEM */
body {
background-color: $bg-color;
.container {
width: 850px;
margin: 70px auto 0px auto;
text-align: center;
h1 {
font: {
family: 'Droid Serif', serif;
weight: 400;
style: normal;
size: 30px;
}
margin-bottom: 30px;
span {
font: {
weight: 700;
style: italic;
}
color: #D90368;
border-bottom: 2px dashed currentColor;
}
}
.button-effect {
padding: 30px 0px;
h2 {
font: {
family: 'Droid Serif', serif;
size: 20px;
}
margin-bottom: 40px;
}
a {
margin-right: 17px;
&:nth-child(2) {
background-color: $button-bg-1;
}
&:nth-child(3) {
background-color: $button-bg-2;
}
&:nth-child(4) {
background-color: $button-bg-3;
}
&:nth-child(5) {
background-color: $button-bg-4;
}
&:nth-child(6) {
background-color: $button-bg-5;
}
&:last-child {
margin-right: 0px;
}
}
}
}
}
/* button styles !!!YOU NEED THEM
!!!ALSO YOU NEED TO ADD FONTWESOME */
.effect {
text-align: center;
display: inline-block;
position: relative;
text-decoration: none;
color: $link-text-color;
text-transform: capitalize;
/* background-color: - add your own background-color */
font: {
family: 'Roboto', sans-serif; /* put your font-family */
size: 18px;
}
padding: 20px 0px;
width: 150px;
border-radius: $border-radius;
overflow: hidden;
}
/* effect-1 styles */
.effect.effect-1 {
transition: all 0.2s linear 0s;
&:before {
content: "\f178";
font-family: FontAwesome;
font-size: 15px;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
right: 0;
top: 0;
opacity: 0;
height: 100%;
width: 40px;
transition: all 0.2s linear 0s;
}
&:hover {
text-indent: -20px;
&:before {
opacity: 1;
text-indent: 0px;
}
}
}
/* effect-2 styles */
.effect.effect-2 {
transition: all 0.2s linear 0s;
&:before {
content: "\f0a4";
font-family: FontAwesome;
font-size: 15px;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
right: -30px;
width: 30px;
height: 100%;
background-color: rgba($overlay-color,0.3);
border-radius: 0px $border-radius $border-radius 0px;
transition: all 0.2s linear 0s;
text-align: center;
}
&:hover {
text-indent: -30px;
&:before {
right: 0;
text-indent: 0px;
}
}
}
/* effect-3 styles */
.effect.effect-3 {
transition: all 0.2s linear 0s;
&:before {
content: "\f178";
font-family: FontAwesome;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 100%;
left: 0px;
width: 100%;
height: 100%;
text-align: center;
font-size: 30px;
transition: all 0.2s linear 0s;
}
&:hover {
text-indent: -9999px;
&:before {
top: 0;
text-indent: 0;
}
}
}
/* effect-4 styles */
.effect.effect-4 {
transition: all 0.2s linear 0s;
&:before {
content: "\f178";
font-family: FontAwesome;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0px;
width: 100%;
height: 100%;
text-align: center;
font-size: 30px;
transform: scale(0,1);
transition: all 0.2s linear 0s;
}
&:hover {
text-indent: -9999px;
&:before {
transform: scale(1,1);
text-indent: 0;
}
}
}
/* effect-5 styles */
.effect.effect-5 {
transition: all 0.2s linear 0s;
&:before {
content: "\f054";
font-family: FontAwesome;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0px;
height: 100%;
width: 30px;
background-color: rgba($overlay-color,0.3);
border-radius: 0 50% 50% 0;
transform: scale(0,1);
transform-origin: left center;
transition: all 0.2s linear 0s;
}
&:hover {
text-indent: 30px;
&:before {
transform: scale(1,1);
text-indent: 0;
}
}
}
View Compiled
//check on github
//https://github.com/eisenfox/css3-button-hovers
This Pen doesn't use any external JavaScript resources.