Glassmorphism 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>Glassmorphism Button</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(to top left, #1e3c72, #2a5298); margin: 0; font-family: 'Arial', sans-serif; } .button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; font-size: 16px; font-weight: bold; color: #ffffff; background: rgba(255, 255, 255, 0.2); border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.1); cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; text-transform: uppercase; position: relative; overflow: hidden; outline: none; } .button::before { content: ''; position: absolute; top: 50%; left: 50%; width: 300%; height: 300%; background: linear-gradient(to top left, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.1)); transition: all 0.5s ease; transform: translate(-50%, -50%) scale(0); z-index: 0; } .button:hover::before { transform: translate(-50%, -50%) scale(1); } .button:hover { transform: scale(1.05); box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.2); } .button i { margin-right: 8px; } .button span { z-index: 1; position: relative; } </style> </head> <body> <button class="button"> <i class="fas fa-star"></i> <span>Click Me</span> </button> <script> // Optional JavaScript can be added here document.querySelector('.button').addEventListener('click', function() { alert('Button Clicked!'); }); </script> </body> </html>