我使用Bootstrap button
,我希望當我點擊它們時,焦點邊框不應該出現在圖標周圍。代碼如下所示。如何在點擊時刪除按鈕的焦點邊框?
<div class="btn-group">
<button class="btn btn-link"> <img src="../images/icons/User.svg" class="svg"></button>
</div>
我使用Bootstrap button
,我希望當我點擊它們時,焦點邊框不應該出現在圖標周圍。代碼如下所示。如何在點擊時刪除按鈕的焦點邊框?
<div class="btn-group">
<button class="btn btn-link"> <img src="../images/icons/User.svg" class="svg"></button>
</div>
使用這種風格,以避免項目
button:focus {
outline: none;
}
感謝它的工作正常!重要的標籤。 –
使用outline:0;
或outline:none;
重點邊境刪除焦點邊境
注:使用!important
在統治結束覆蓋Bootstrap聲明
button:focus{
outline:0 !important;
}
或
button:focus{
outline:none !important;
}
試一次
button:focus{
outline:0px;
}
還使用
button:focus{
outline:none !important;
}
我不得不修改!重要那麼它做工精細。
沒有其他答案這就是爲什麼我給你同樣的答案 –
試試這個 button:focus {outline:0!important; } –
它不工作的兄弟。 –
兩個想法 - 首先 - 在活動狀態/焦點上的邊界是在可訪問性方面的一個重要行動指標(讓用戶知道他們做了什麼/關注點 - 所以在移除它時要小心)。 !重要的不應該被推薦,因爲它會影響整個樣式表。 – gavgrif