我可以让输入元素响应 :hover
和 :hover:disable
但看起来 div 的响应不一样。
.btn {
width: 99px;
border-color: 2px #787878;
background-color: #CACACA;
margin-left: 76px;
margin-top: 21px;
position: relative;
border-radius: 26px;
-moz-border-radius: 26px;
-webkit-border-radius: 26px;
cursor: pointer;
}
.btn:hover:disabled {
background: red;
cursor: no-drop;
}
<div class="btn" id="divDisable" style=" height: 30px;line-height: 30px; text-align: center;" disabled>Disabled
</div>
<input class="btn" id="iDisabled" type="submit" value="Disabled" disabled>
Full Sample尽我所能
奖金信息
问题是答案 div 没有禁用
最佳答案
div 元素没有禁用属性。在这种情况下,您可以为您的 CSS 添加一个类。
div.divDisable:hover {}
关于html - 如何设置禁用 DIV 元素的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29176489/