主頁
CSS
CSS 按鈕
Tryit:帶漣漪效果的動畫按鈕 - 點選時新增漣漪效果
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .button { position: relative; background-color: #04AA6D; border: none; font-size: 28px; color: #FFFFFF; padding: 20px; width: 200px; text-align: center; transition-duration: 0.4s; text-decoration: none; overflow: hidden; cursor: pointer; } .button:after { content: ""; background: #f1f1f1; display: block; position: absolute; padding-top: 300%; padding-left: 350%; margin-left: -20px !important; margin-top: -120%; opacity: 0; transition: all 0.8s } .button:active:after { padding: 0; margin: 0; opacity: 1; transition: 0s } </style> </head> <body> <h2>Animated Button - Ripple Effect</h2> <button class="button">Click Me</button> </body> </html>