Friday, 3 January 2020

Awesome Hover effect to button in html


Awesome Hover effect to button in html 


HTML Code

index.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Hover button</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <button type="button" class="button">Click Me</button>
  </body>
</html>
                                      Download : Code
style.css

*{
  margin: 0;
  padding: 0;
  font-family: "montserrat",sans-serif;
}

body{
  background: #353b48;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button{
  width: 200px;
  height: 60px;
  background: none;
  border: 4px solid;
  color: #3498db;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 16px;
  position: relative;
}

.button::after,.button::before{
  content: "";
  position: absolute;
  width: 14px;
  height: 4px;
  background: #353b48;
  transform: skewX(50deg);
  transition: .4s linear;
}

.button::before{
  top:-4px;
  left: 10%;
}

.button::after{
  bottom: -4px;
  right: 10%;
}

.button:hover::before{
  left: 80%;
}

.button:hover::after{
  right: 80%;
}

Output



No comments:

Donate