Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove outline of html button

I have button on my html page, when i click on that button it show me outer line to button shown as below image.

enter image description here

here when i click on reset button it show me outer as above image.

Html code:

< input type="reset" value="" class="resetButton" />

css code:

.resetButton
{
    margin: 0px;
    background:url(../images/button/Reset2.png) no-repeat;
    border: none; 
    width: 90px;
    height: 32px;
    cursor: pointer;
}
like image 720
Vijay Avatar asked Oct 18 '13 10:10

Vijay


3 Answers

Use this:

input[type="reset"]:focus{
    outline: none;   
}

or just

input:focus{
    outline: none;   
}

if you don't want that outline to all the input types.

like image 109
Mr_Green Avatar answered Sep 22 '22 13:09

Mr_Green


Just add display: block;

.resetButton
{
    margin: 0px;
    background:url(../images/button/Reset2.png) no-repeat;
    display: block;
    border: none; 
    width: 90px;
    height: 32px;
    cursor: pointer;
}
like image 39
Valerxx22 Avatar answered Sep 21 '22 13:09

Valerxx22


This is normally a chrome issue, the main thing to note here is that it is an outline not a border.

Try

.resetButton{ outline: none; }

For more info check out http://www.w3.org/TR/CSS2/ui.html#dynamic-outlines

Also check out this post on the dangers of removing the border completely Google Chrome > Textboxes > Yellow border when active..?

like image 44
Dominic Green Avatar answered Sep 21 '22 13:09

Dominic Green