首页
CSS
CSS 按钮
尝试:禁用按钮
运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 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>