我正在尝试以下方法:
button:disabled {
border-color: #50a3c8 #297cb4 #083f6f;
background: #0c5fa5 url(/Content/images/old-browsers-bg/button-element-bg.png) repeat-x left top;
.top-gradient( #FFF, #72c6e4, 4%, #0c5fa5);
color: white;
}
button:not(disabled):hover {
border-color: #1eafdc #1193d5 #035592;
background: #057fdb url(/Content/images/old-browsers-bg/button-element-hover-bg.png) repeat-x left top;
.top-gradient(#FFF, #2bcef3, 4%, #057fdb);
}
但是我的IDE说“禁用”不是有效的HTML标记,但仅适用于第二个CSS定义,其中禁用括在括号中。
答案 0 :(得分:1)
答案 1 :(得分:1)
试试这个,使用:not(:disabled)
button:not(:disabled):hover {
border-color: #1eafdc #1193d5 #035592;
background: #057fdb url(/Content/images/old-browsers-bg/button-element-hover-bg.png) repeat-x left top;
.top-gradient(#FFF, #2bcef3, 4%, #057fdb);
}