Dark CSS

Create Amazing Button Hover Effect using Html and CSS

Facebook
Twitter
WhatsApp

Project demo

html code

				
					<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS BUTTON HOVER EFFECT</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <button>Button</button>
</body>

</html>
				
			

css code

				
					body {
    display: flex;
    justify-content: center;
    place-items: center;
    min-height: 100vh;
    background: #e8e8e8;
    overflow: hidden;
}

button {
    position: relative;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.7em 2em;
    font-size: 18px;
    letter-spacing: 2px;
    border-radius: 2px;
    border: 3px solid #00a8ff;
    color: #00a8ff;
    cursor: pointer;
    transition: 0.3s ease all;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16),
        0 3px 6px rgba(0, 0, 0, 0.1);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    right: 50%;
    opacity: 0;
    z-index: -1;
    background: #00a8ff;
    transition: .5s all ease;
}

button:hover,
button:focus {
    color: #fff;
}

button:hover:before,
button:focus::before {
    left: 0;
    right: 0;
    opacity: 1;
}

button:active {
    transform: scale(0.9);
}