<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Create button hover</title>
</head>
<body>
<h3>
Creative buttons, showing icon on mouse over
</h3>
<div>
<button class="btn-1">Hover over me</button>
</div>
<div>
<button class="login-btn">Login</button>
</div>
<div>
<button class="logout-btn">Logout</button>
</div>
</body>
<!-- Footer starts-->
<footer class="footer">
<!-- Copyright -->
<!-- ❤️ -->
<div class="footer-copyright text-center">© Developed with <i class="fas fa-heart" aria-hidden="true"></i> by
<a href="https://grohit.com/" class="white-text">G Rohit</a>. <a href="https://codepen.io/grohit/">Check my other pens </a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer ends-->
</html>
html {
position: relative;
min-height: 100%;
}
body {
background: #ffffff;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
font-weight: 400;
flex-direction: column;
position: relative;
font-family: Hack, monospace;
div {
margin: 20px;
}
}
.btn-1 {
font-family: Hack, monospace;
background: #0F0F6D;
color: #ffffff;
cursor: pointer;
font-size: 2em;
padding: 1.5rem;
border: 0;
transition: all 0.5s;
border-radius: 10px;
width: auto;
position: relative;
&::after {
content: "\f054";
font-family: "Font Awesome 5 Pro";
font-weight: 400;
position: absolute;
left: 85%;
top: 31%;
right: 5%;
bottom: 0;
opacity: 0;
}
&:hover {
background: #2b2bff;
transition: all 0.5s;
border-radius: 10px;
box-shadow: 0px 6px 15px #0000ff61;
padding: 1.5rem 3.5rem 1.5rem 1.5rem;
&::after {
opacity: 1;
transition: all 0.5s;
}
}
}
.login-btn {
font-family: Hack, monospace;
background: #bbff00;
color: #1d1d1d;
cursor: pointer;
font-size: 2em;
padding: 1.5rem;
border: 0;
transition: all 0.5s;
border-radius: 10px;
width: auto;
position: relative;
min-width: 250px;
&::after {
content: "\f2f6";
font-family: "Font Awesome 5 Pro";
font-weight: 400;
position: absolute;
left: 80%;
top: 54%;
right: 0;
bottom: 0;
opacity: 0;
transform: translate(-50%, -50%);
}
&:hover {
background: #2b2bff;
transition: all 0.5s;
border-radius: 10px;
box-shadow: 0px 6px 15px #0000ff61;
padding: 1.5rem 3rem 1.5rem 1.5rem;
color: #ffffff;
&::after {
opacity: 1;
transition: all 0.5s;
color: #ffffff;
}
}
}
.logout-btn {
font-family: Hack, monospace;
background: #d3d3d3;
color: #2c2c2c;
cursor: pointer;
font-size: 2em;
padding: 1.5rem;
border: 0;
transition: all 0.5s;
border-radius: 10px;
width: auto;
position: relative;
min-width: 250px;
&::after {
content: "\f2f5";
font-family: "Font Awesome 5 Pro";
font-weight: 400;
position: absolute;
left: 80%;
top: 54%;
right: 0;
bottom: 0;
opacity: 0;
transform: translate(-50%, -50%);
}
&:hover {
background: #2b2bff;
transition: all 0.5s;
border-radius: 10px;
box-shadow: 0px 6px 15px #0000ff61;
padding: 1.5rem 3rem 1.5rem 1.5rem;
color: #ffffff;
&::after {
opacity: 1;
transition: all 0.5s;
color: #ffffff;
}
}
}
.footer {
position: absolute;
font-size: 12px;
bottom: 0;
width: 100%;
height: 60px; /* Set the fixed height of the footer here */
background-color: #f5f5f5;
text-align: center;
a {
text-decoration: none;
color: inherit;
border-bottom: 1px solid;
&:hover {
border-bottom: 1px transparent;
}
}
}
View Compiled
This Pen doesn't use any external JavaScript resources.