CSS Buttons
body {
background-color: #231f20;
font-family: "Quicksand", sans-serif;
text-align: center;
}
h1 {
color: #fff;
font-size: 3rem;
font-family: "Righteous", cursive;
letter-spacing: 2px;
}
.container {
width: 100%;
}
.button {
width: 150px;
height: 50px;
cursor: pointer;
float: left;
margin: 15px;
}
/* ===== HOVER GRADIENT BUTTONS ===== */
.button1,
.button2,
.button1-2,
.button2-2 {
border-radius: 15px;
font-size: 1.125rem;
font-weight: 700;
padding-top: 10px;
color: #fff;
}
.button1 {
background: linear-gradient(-45deg, #00275e, #6d98ab, #00275e);
box-shadow: 15px 15px 0px #feb729;
transition: all 0.3s ease;
background-size: 400% 400%;
}
.button1:hover {
box-shadow: 5px 5px 0px #feb729;
transition: all 0.3s ease;
animation: gradient 10s ease infinite;
}
.button2 {
background: linear-gradient(-45deg, #006295, #9be1fb, #006295);
box-shadow: 5px 5px 0px #bd2031;
transition: all 0.3s ease;
background-size: 400% 400%;
}
.button2:hover {
box-shadow: 15px 15px 0px #bd2031;
transition: all 0.3s ease;
animation: gradient 10s ease infinite;
}
.button1-2 {
background: linear-gradient(-45deg, #ffd5b5, #fab279, #cc223b);
box-shadow: -15px -15px 0px #7a091a;
transition: all 0.3s ease;
background-size: 400% 400%;
}
.button1-2:hover {
box-shadow: -5px -5px 0px #7a091a;
transition: all 0.3s ease;
animation: gradient 10s ease infinite;
}
.button2-2 {
background: linear-gradient(-45deg, #ffed00, #bfba3d, #7ebc57);
box-shadow: 5px 5px 0px #2eac66;
transition: all 0.3s ease;
background-size: 400% 400%;
}
.button2-2:hover {
box-shadow: 15px 15px 0px #2eac66;
transition: all 0.3s ease;
animation: gradient 10s ease infinite;
}
@keyframes gradient {
50% {
background-position: 100% 0;
}
}
/* ===== PUSH AND PULL ===== */
.button3,
.button4,
.button3-2,
.button4-2 {
border-radius: 15px;
color: #fff;
font-size: 1.2rem;
font-weight: 700;
padding-top: 5px;
text-transform: uppercase;
border: 5px solid #fff;
}
.button3 {
box-shadow: -15px 20px 0px #fff;
transition: all 0.3s ease;
transform: translate3d(0.6em, -0.6em, 0);
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-delay: 220ms;
}
.button3:active {
box-shadow: 0px 0px 0px #fff;
transform: translate3d(0, 0, 0);
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.button4 {
box-shadow: 0px 0px 0px #fff;
transition: all 0.3s ease;
transform: translate3d(0, 0, 0);
transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.button4:active {
box-shadow: -15px 20px 0px #fff;
transform: translate3d(0.6em, -0.6em, 0);
transition: all 240ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-delay: 0.22s;
}
.button3-2 {
box-shadow: -15px 20px 0px #fff;
transition: all 0.3s ease;
transform: translate3d(0.6em, -0.6em, 0);
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-delay: 0.22s;
}
.button3-2:active {
box-shadow: 0px 0px 5px #fff;
transform: translate3d(0, 0, 0);
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
border-color: transparent;
}
.button4-2 {
box-shadow: 0px 0px 5px #fff;
transition: all 0.3s ease;
transform: translate3d(0, 0, 0);
transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
border-color: transparent;
}
.button4-2:active {
box-shadow: -15px 20px 0px #fff;
transform: translate3d(0.6em, -0.6em, 0);
transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-delay: 220ms;
border-color: #fff;
}
/* ===== DIRECTIONAL COLOR IN ===== */
.button5,
.button6,
.button7,
.button8 {
padding-top: 3px;
height: 30px;
}
.button5 {
color: #f3eedb;
border: solid #f3eedb 1px;
background: linear-gradient(270deg, #f3eedb, #c9c4b1, #231f20, #231f20);
background-color: #231f20;
background-position: 1% 50%;
background-size: 300% 300%;
transition: all 0.7s ease-out;
}
.button5:hover {
color: #231f20;
background-position: 99% 50%;
}
.button6 {
color: #231f20;
border: solid #f3eedb 1px;
background: linear-gradient(270deg, #f3eedb, #c9c4b1, #231f20, #231f20);
background-color: #231f20;
background-position: 99% 50%;
background-size: 300% 300%;
transition: all 0.7s ease-out;
}
.button6:hover {
color: #f3eedb;
background-position: 1% 50%;
}
.button7 {
color: #f3eedb;
border: solid #f3eedb 1px;
background: linear-gradient(0deg, #f3eedb, #c9c4b1, #231f20, #231f20);
background-color: #231f20;
background-position: 1% 1%;
background-size: 300% 300%;
transition: all 0.7s ease-out;
}
.button7:hover {
color: #231f20;
background-position: 99% 99%;
}
.button8 {
color: #f3eedb;
border: solid #f3eedb 1px;
background: linear-gradient(0deg, #f3eedb, #c9c4b1, #231f20, #231f20);
background-size: 300% 300%;
transition: all 0.7s ease-out;
color: #231f20;
background-position: 99% 99%;
}
.button8:hover {
color: #f3eedb;
background-position: 1% 1%;
}
/* ===== CALL TO ACTION BUTTONS ===== */
.button9,
.button10,
.button9-2,
.button10-2 {
padding-top: 10px;
height: 30px;
border-radius: 5px;
color: #fff;
font-weight: 700;
position: relative;
}
.button9 {
background-color: #377420;
box-shadow: 0px 3px 0px #214413;
animation: wiggle infinite 5s;
}
.button9:active {
top: 1px;
}
@keyframes wiggle {
0% {
transform: rotate(0deg);
}
3% {
transform: rotate(-1deg);
}
4% {
transform: rotate(1deg);
}
5% {
transform: rotate(0deg);
}
100% {
transform: rotate(0deg);
}
}
.button10 {
background-color: #742020;
box-shadow: 0px 3px 0px #4f1616;
animation: pulse infinite 5s;
}
.button10:active {
position: relative;
top: 1px;
}
@keyframes pulse {
0% {
transform: scale(1);
}
3% {
transform: scale(1.05);
}
4% {
transform: scale(1);
}
5% {
transform: scale(1.05);
}
6% {
transform: scale(1);
}
100% {
transform: scale(1);
}
}
.button9-2 {
border-radius: 5px;
font-weight: 400;
color: #00c7ec;
background-color: #012839;
height: 35px;
border: 1px solid #00c7ec;
transition: all 0.2s ease-out;
position: relative;
animation: glow 2s ease-in infinite;
}
.button9-2:hover {
background-color: #00c7ec;
color: #fff;
border-color: #00c7ec;
transition: all 0.2s ease-in;
}
.button9-2:active {
top: 1px;
}
@keyframes glow {
0% {
box-shadow: 0 0 0 0 transparent;
}
50% {
box-shadow: 0 0 30px 0 rgba(0, 199, 236, 0.5);
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
.button10-2 {
font-weight: 400;
color: #fff;
background-color: transparent;
height: 40px;
border: 2px solid #fff;
border-radius: 2px;
font-weight: 700;
}
.button10-2:before {
content: "";
display: block;
position: absolute;
box-sizing: border-box;
width: 175px;
left: -12px;
top: -10px;
height: 70px;
border: 2px solid #fff;
border-radius: 2px;
opacity: 0;
animation: show 5s infinite;
}
.button10-2:hover {
border: 2px solid transparent;
}
.button10-2:active {
top: 1px;
}
@keyframes show {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
60% {
opacity: 0;
}
100% {
opacity: 0;
}
}
/* ===== PUSH BUTTONS ===== */
.button11,
.button12 {
height: 30px;
width: 70px;
border-radius: 5px;
color: #fff;
border: 1px solid;
border-color: #4a2f8c #482e89 #3c2672;
}
.button11 {
padding-top: 3px;
box-shadow: 0px 0px 1px 1px rgba(66, 169, 51, 1);
border: none;
background: linear-gradient(to bottom, #31741b 0%, #3fa131 60%, #42a933 100%);
}
.button11:active {
background: linear-gradient(to bottom, #42a933 0%, #3fa131 50%, #31741b 100%);
}
.button12 {
padding-top: 0px;
border: 2px solid #7753c5;
box-shadow: inset 0px 0px 1px 1px rgba(130, 94, 201, 1);
background: linear-gradient(
to bottom,
#825ec9 0%,
#7d53c5 50%,
#6440be 50%,
#482da8 100%
);
}
.button12:active {
background: linear-gradient(
to bottom,
#482da8 0%,
#6440be 50%,
#7d53c5 50%,
#825ec9 100%
);
}
/* ===== ROTATING BUTTONS ===== */
.button13,
.button14,
.button13-2,
.button14-2 {
border-radius: 50%;
width: 80px;
height: 80px;
color: #fff;
transition: all 0.2s ease;
border: 2px solid transparent;
}
.button13 {
background-color: #c0392b;
font-size: 2.5rem;
}
.button13:hover {
border: 2px solid #c0392b;
color: #c0392b;
}
.button14 {
background-color: #e67e22;
font-size: 2.2rem;
}
.button14:hover {
border: 2px solid #e67e22;
color: #e67e22;
}
.button13-2 {
background-color: #2bbf86;
font-size: 2.2rem;
}
.button13-2:hover {
border: 2px solid #2bbf86;
color: #2bbf86;
}
.button14-2 {
background-color: #842bbf;
font-size: 2.2rem;
}
.button14-2:hover {
border: 2px solid #842bbf;
color: #842bbf;
}
.button13 i,
.button14 i,
.button13-2 i,
.button14-2 i {
margin: 20px;
}
.button13:hover,
.button14:hover,
.button13-2:hover,
.button14-2:hover {
background-color: #fff;
transform: rotate(50deg) scale(1.1);
box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.5);
}
.button13:active,
.button14:active,
.button13-2:active,
.button14-2:active {
position: relative;
top: 1px;
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
transition: all 0.1s ease-in;
}
/* ===== HOVER ARROW BUTTONS ===== */
.button15,
.button16,
.button17,
.button18 {
width: 150px;
height: 25px;
color: #fff;
padding: 15px 0;
font-size: 1.2rem;
border-radius: 5px;
}
.button15 {
background-color: #2c3e50;
}
.button15 span {
transition: 0.3s;
}
.button15 span::after {
content: "\00bb";
opacity: 0;
transition: 0.3s;
}
.button15:hover span {
padding-right: 10px;
}
.button15:hover span:after {
opacity: 1;
}
.button16 {
background-color: #7f8c8d;
font-weight: 700;
}
.button16 i {
opacity: 0;
font-size: 1rem;
padding-left: 2px;
}
.button16:hover i {
opacity: 1;
transition: 0.3s;
position: relative;
top: 1px;
animation: point 2s infinite ease;
}
@keyframes point {
0% {
left: 0;
}
5% {
left: 5px;
}
10% {
left: 0;
}
15% {
left: 5px;
}
20% {
left: 0;
}
100% {
left: 0;
}
}
.button17 {
border: 1px solid #fff;
color: #000;
background-color: #fff;
font-weight: 700;
text-transform: uppercase;
position: relative;
overflow: hidden;
}
.button17 span {
display: block;
}
.button17::before {
content: "";
display: block;
width: 0;
height: 0;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
border-right: 30px solid #2b95bf;
position: absolute;
bottom: -32%;
left: -1px;
transform: rotate(-45deg) translateX(-50px);
transition: transform 0.2s ease;
}
.button17::after {
content: "";
display: block;
width: 0;
height: 0;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
border-right: 30px solid #2b95bf;
position: absolute;
top: -32%;
right: -2px;
transform: rotate(135deg) translateX(-50px);
transition: transform 0.2s ease;
}
.button17:hover::before {
transform: rotate(-45deg) translateX(0);
}
.button17:hover::after {
transform: rotate(135deg) translateX(0);
}
.button17:active {
top: 1px;
}
.button18 {
color: #c1ff9b;
border: 1px solid #c1ff9b;
}
<h1>Button Styles</h1>
<div class="row">
<div class="container ">
<div class="button button1">Hover Me</div>
<div class="button button2">Hover Me</div>
<div class="button button1-2">Hover Me</div>
<div class="button button2-2">Hover Me</div>
</div>
<div class="container">
<div class="button button3">Push Me</div>
<div class="button button4">Pull Me</div>
<div class="button button3-2">Push Me</div>
<div class="button button4-2">Pull Me</div>
</div>
<div class="container">
<div class="button button5">Left</div>
<div class="button button6">Right</div>
<div class="button button7">Up</div>
<div class="button button8">Down</div>
</div>
<div class="container">
<div class="button button9">Call To Action</div>
<div class="button button10">Call To Action</div>
<div class="button button9-2">Call To Action</div>
<div class="button button10-2">Call To Action</div>
</div>
<div class="container">
<div class="button button11">Push</div>
<div class="button button12">Push</div>
</div>
<div class="container">
<div class="button button13"><i class="fa fa-cog" aria-hidden="true"></i></div>
<div class="button button14"><i class="fa fa-hashtag" aria-hidden="true"></i></div>
<div class="button button13-2"><i class="fa fa-tag" aria-hidden="true"></i></div>
<div class="button button14-2"><i class="fa fa-star-o" aria-hidden="true"></i></div>
</div>
<div class="container">
<div class="button button15"><span>Hover </span></div>
<div class="button button16">Hover <i class="fa fa-chevron-right" aria-hidden="true"></i></div>
<div class="button button17"><span>Hover </span></div>
<div class="button button18"><span>Hover</span</div>
</div>
</div> <!-- row -->
Just a whole bunch of random button styles I have seen around the web re-created in a Pen.
A Pen by HARUN PEHLİVAN on CodePen.