how to remove outline of html button

后端 未结 7 1620
执念已碎
执念已碎 2020-12-19 06:53

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

相关标签:
7条回答
  • 2020-12-19 07:08

    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..?

    0 讨论(0)
  • 2020-12-19 07:13

    Try this.

    .resetButton, .resetButton:visited
    {
        margin: 0px;
        background:url(../images/button/Reset2.png) no-repeat;
        display: block;
    
        width: 90px;
        height: 32px;
        cursor: pointer;
        border: none;
        outline: none;
    }
    
    0 讨论(0)
  • 2020-12-19 07:14

    Just add this to your CSS:

    .resetButton:focus {
        outline: none;
    }
    
    0 讨论(0)
  • 2020-12-19 07:20

    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.

    0 讨论(0)
  • 2020-12-19 07:21

    Add an outline: none to your css:

    .resetButton
    {
        margin: 0px;
        background:url(../images/button/Reset2.png) no-repeat;
        border: none; 
        width: 90px;
        height: 32px;
        cursor: pointer;
        outline: none;
    }
    
    0 讨论(0)
  • 2020-12-19 07:25

    Take a look on the outline CSS property.

    To style a button that is being clicked, you can use :active pseudo-class.

    0 讨论(0)
提交回复
热议问题