html
<button class="button disabled >禁用按钮</button>
css样式
.button {
background-color: #4CAF50; /* 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;//添加 cursor 属性并设置为 "not-allowed" 来设置一个禁用的图片
}
注意:
cursor: not-allowed;//添加 cursor 属性并设置为 "not-allowed" 来设置一个禁用的图片
最终效果: