主頁
CSS
CSS 按鈕
Tryit: 停用按鈕
執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .button { background-color: #04AA6D; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } .disabled { opacity: 0.6; cursor: not-allowed; } </style> </head> <body> <h2>Disabled Button</h2> <p>Use the opacity property to add some transparency to a button (make it look disabled):</p> <button class="button">Normal Button</button> <button class="button disabled">Disabled Button</button> </body> </html>