Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Added background and hover effect #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
body{
background-color:#E0E5EC;
height: 100vh;
margin: 0;
text-align: center;
display: grid;
padding-top: 200px;
}
button{
background-color: #E0E5EC;
border: none;
border-radius: 6px;
box-shadow: 9px 9px 16px rgba(163,177,198,0.6);
font-weight: 700;
height: 96px;
margin-bottom: 48px;
margin-right: 48px;
overflow: hidden;
position: relative;
text-transform: uppercase;
width: 96px;
}
button::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 200%;
height: 100%;
opacity: 0;
transform: translateX(-100%);
background: rgba(255,255,255,0.13);
background: linear-gradient(to right,rgba(255,255,255,0.13),rgba(255,255,255,0.13),rgba(255,255,255,0.13));
}
button:hover::after{
opacity: 1;
top: 0;
left: 0;
transform: translateX(0);
transition-property: transform,opacity;
transition-duration: 0.7s,0.15s;
transition-timing-function: ease;
}
button:active::after
{
opacity: 0;
}
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width-device=width,initial-width=1.0">
<title>Beautiful Button Using CSS</title>
<link rel="stylesheet" href="index.css">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
</head>
<body>
<div id="buttons">
<button type="submit"><i class="fa fa-lock"></i></button>
<button type="submit"><i class="fa fa-copyright" aria-hidden="true"></i></button>
<button type="submit"><i class="fa fa-clone" aria-hidden="true"></i></button>
<button type="submit"><i class="fa fa-archive" aria-hidden="true"></i></button>
<button type="submit"><i class="fa fa-shopping-cart" aria-hidden="true"></i></button>
</div>
</body>
</html>