Botton Hover Effect

Botton Hover Effect Code:

1.index.html:

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Botton Hover Effect</title> <link rel="stylesheet" href="style.css"> </head> <body> <a href="#">Button</a> </body> </html>

2.style.css:

body { margin: 0; padding: 0; } a { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 180px; height: 60px; text-align: center; background: black; color: white; font-size: 39px; text-decoration: none; font-family: Verdana, Geneva, Tahoma, sans-serif; letter-spacing: 4px; box-shadow: 0 5px 5px rgba(0,0,0,0.2); border: 2px solid blue; transition: 0.5s; } a:hover { background: white; text-shadow: 0 5px 5px rgba(0,0,0,0.5); } a::before, a::after { content: ''; position: absolute; width: 54%; height: 100%; background: red; z-index: -1; opacity: 0; } a:hover::before { opacity: 1; top: 5px; left: -5px; box-shadow: 0 5px 5px rgba(0,0,0,0.2); animation: animate 2s linear infinite; } a:hover::after { opacity: 1; top: -5px; right: -5px; box-shadow: 0 5px 5px rgba(0,0,0,0.2); animation: animate 2s linear infinite; animation-delay: -1s; } @keyframes animate { 0% { top: 5px; } 50% { top: -5px; } 100% { top: 5px; } }

Оставьте комментарий

Ваш адрес email не будет опубликован.