Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gradient Button</title> <style> /* Component: Animated Gradient Button Description: A button with a CSS gradient background and a subtle hover animation. */ :root { --grad-color-1: #ff8c00; --grad-color-2: #ff0080; --grad-text-color: #ffffff; --grad-focus-outline: #ff8c00; } .gradient-container-1 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; display: flex; justify-content: center; align-items: center; padding: 2rem; background-color: #1e1e1e; /* Dark background to make the gradient pop */ } .gradient-btn-1 { display: inline-block; padding: 1rem 2.2rem; font-size: 1.1rem; font-weight: 700; line-height: 1.5; text-align: center; color: var(--grad-text-color); background-image: linear-gradient(100deg, var(--grad-color-1), var(--grad-color-2), var(--grad-color-1)); background-size: 200% 100%; /* Make gradient wider than button */ border: none; border-radius: 8px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transition: all 0.4s ease-in-out; } .gradient-btn-1:hover { background-position: 100% 0; /* Shift gradient to the other end */ transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); } .gradient-btn-1:active { transform: translateY(0); } .gradient-btn-1:focus-visible { outline: 3px solid var(--grad-focus-outline); outline-offset: 3px; } </style> </head> <body> <div class="gradient-container-1"> <button type="button" class="gradient-btn-1">Join the Movement</button> </div> </body> </html>