在我的網站上有一個禁用的按鈕。懸停事件發生後,它會更改錯誤的顏色。什麼是引導禁用按鈕懸停類名稱?
我想更改此按鈕的懸停顏色,我找不到/不知道什麼是禁用的類名稱按鈕懸停在引導框架中爲此問題。
〔實施例是:
<button type="submit" class="btn btn-primary" disabled="disabled">My disabled button</button>
在我的網站上有一個禁用的按鈕。懸停事件發生後,它會更改錯誤的顏色。什麼是引導禁用按鈕懸停類名稱?
我想更改此按鈕的懸停顏色,我找不到/不知道什麼是禁用的類名稱按鈕懸停在引導框架中爲此問題。
〔實施例是:
<button type="submit" class="btn btn-primary" disabled="disabled">My disabled button</button>
這是兩種類型的殘疾人按鈕,你可以引導使:
1.Disabled UI,而不是按鈕本身[使用類disabled
(試點擊片段中的按鈕)
2.Button disabled | 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>
引導有禁止類按鈕 你可以使用這樣
<input type="submit" class="btn btn-default" disabled>
CSS
input[disabled] {
cursor:not-allowed;
}
的按鈕關閉沒有任何JavaScript的需要。
這不會實際上禁用按鈕。它只會添加禁用的效果,即:按鈕仍然是可點擊的! –
只需在您的代碼輸入中添加小css [禁用] {0} {0} {0} {0}光標:不允許; } – Hacker
是不是任何瀏覽器的默認行爲?你只需要將'disabled'屬性添加到按鈕mate':)' –
謝謝你的幫助。 我發現這個問題的類名稱正確。
只要把
.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;
}
我用這個。
這裏有什麼問題?爲什麼你的班級名單外的「禁用」班? –
難道你有一個css定義覆蓋默認的禁用懸停背景? – sk904861
@GurtejSingh這是一個屬性,而不是類名 –