2014-02-28 16 views
2

我有一個自定義按鈕類(在線創建,因爲這是我在網頁上的第一次嘗試)。當點擊它時,直到點擊其他東西,按鈕周圍會出現灰色邊框,可能是兩個像素厚度的框。當點擊其他東西時,它會消失(我的自定義按鈕有圓角,因此它很清晰可見)CSS如何擺脫自定義按鈕周圍出現的邊框並單擊後

OS-X上的Safari沒有出現此消息,但是Chrome會顯示此消息,使用FireFox時,邊框爲1像素厚,出現在我的自定義文件夾內的一個盒子(它不會因爲我們堅持了IE8的,而在IE中運行。)這是煩人

HTML:。

<button class='command-btn' type='button' id='find-camera-btn'>Find Camera</button> 

CSS3:

.command-btn { 
    font-family: Arial, Helvetica, sans-serif; 
    font-size: 16px; 
    color: blue; 
    width: 130px; 
    height: 40px; 
    float: left; 
    margin: 6px 0px 5px 10px; 
    background: -moz-linear-gradient(top, #0aa31b 0%, #d7de16 99%, #ebeb0e); 
    background: -webkit-gradient(linear, left top, left bottom, from(#0aa31b), 
    color-stop(0.99, #d7de16), to(#ebeb0e)); 
    -moz-border-radius: 14px; 
    -webkit-border-radius: 14px; 
    border-radius: 14px; 
    border: 1px solid #6d8000; 
    -moz-box-shadow: 0px 1px 3px rgba(000, 000, 000, 0.5), inset 0px 0px 2px 
    rgba(255, 255, 255, 1); 
    -webkit-box-shadow: 0px 1px 3px rgba(000, 000, 000, 0.5), inset 0px 0px 
     2px rgba(255, 255, 255, 1); 
    box-shadow: 0px 1px 3px rgba(000, 000, 000, 0.5), inset 0px 0px 2px 
    rgba(255, 255, 255, 1); 
    text-shadow: 0px -1px 0px rgba(000, 000, 000, 0.2), 0px 1px 0px 
    rgba(255, 255, 255, 0.4); 
} 

我正在使用Dart,但「OnClick」方法中的代碼無關緊要。如果我可以在解決問題的點擊後移動焦點,但我不知道如何做到這一點。

回答

5

Addind規則:

outline: 0; 

應該做的工作

+0

簡單,和作品! – HerrimanCoder

0

你試過outline: none

1
.command-btn, 
.command-btn:focus, 
.command-btn:active { 
    border: 0; 
    outline: 0; 
} 
+0

這不僅僅是必要的 –

+0

是的,但是輸入全部內容更加有趣。 – Deryck

相關問題