Border Animation Button - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Border Animation Button</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #333; margin: 0; } .border-animation-button { padding: 20px 40px; font-size: 18px; font-weight: bold; color: #fff; background: #3498db; border: 4px solid transparent; border-radius: 30px; cursor: pointer; outline: none; position: relative; transition: all 0.3s ease; } .border-animation-button::before { padding: 37px 40px; content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; background: linear-gradient(45deg, #ff0000, #ff00ff, #0000ff, #00ff00, #ff0000); background-size: 400%; border-radius: 30px; z-index: -1; animation: border-animation 5s infinite; transition: all 0.3s ease; } @keyframes border-animation { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } .border-animation-button:hover::before { filter: brightness(1.2); } .border-animation-button span { position: relative; z-index: 1; } </style> </head> <body> <button type="button" class="border-animation-button"> <span>Border Animation</span> </button> </body> </html>