在我的网站上,我有一个禁用按钮。悬停事件后,它会更改错误的颜色。
我想更改此按钮的悬停颜色,我无法找到/不知道什么是类名禁用按钮悬停在bootstrap框架中此问题。
例如:
<button type="submit" class="btn btn-primary" disabled="disabled">My disabled button</button>
这些是您可以使用bootstrap创建的两种类型的禁用按钮:
1.Disabled UI,但不是按钮本身[使用类disabled
](尝试单击代码段中的按钮)
2.Button残疾人|默认情况下,Bootstrap在此处应用禁用的效果。 [或同时使用:属性和disabled
类]。
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<button type="submit" class="btn btn-primary disabled" onclick="alert('not actaully disabled');">My disabled button</button>
<button type="submit" class="btn btn-primary" disabled onclick="alert('not actaully disabled');">My disabled button</button>
谢谢您的帮助。我找到了这个问题的正确的类名。
刚刚放
.btn[disabled]:hover {
background:#bedd16;
}
.btn[disabled]:active:focus {
color: #000000;
}
.btn[disabled]:focus {
background: #bedd16;
color: #666666;
}
更改禁用按钮悬停背景...;)
.btn-default[disabled] {
background: #ccc !important;
}
.btn-default[disabled]:hover {
background: #ccc !important;
}
我正在使用它。
Bootstrap在你可以使用的按钮中禁用了类
<input type="submit" class="btn btn-default" disabled>
CSS
input[disabled] {
cursor:not-allowed;
}
没有任何JavaScript需要按钮禁用。