如何样式禁用DIV元素 [英] How to Style a disable DIV element
本文介绍了如何样式禁用DIV元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使一个输入元素响应:hover
和:hover:disable
但看起来像一个div不反应相同。
.btn {width:99px; border-color:2px#787878; background-color:#CACACA; margin-left:76px; margin-top:21px;位置:相对; border-radius:26px; -moz-border-radius:26px; -webkit-border-radius:26px; cursor:pointer;}。btn:hover:disabled {background:red; cursor:no-drop;}
< div class = btnid =divDisablestyle =height:30px; line-height:30px; text-align:center;禁用>禁用< / div>< input class =btnid =iDisabledtype =submitvalue =Disableddisabled>
完整示例与我所尝试的一切
红利信息
有禁用
div.divDisable:hover {}
$>您可以在这种情况下为CSS添加一个类。 c $ c>
I can make an input element respond to :hover
and :hover:disable
But looks like a div doesn't respond the same.
.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 with everything i tried
Bonus Info
Question was answer div doesn't have Disable
解决方案
A div element doesn't have a disable attribute. You could add a class in this case for your CSS.
div.divDisable:hover {}
这篇关于如何样式禁用DIV元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文