How To Remove Outline Border From Input Button

后端 未结 14 1522
有刺的猬
有刺的猬 2020-12-02 08:43

when click somewhere else the border disappears, tried onfocus none, but didn\'t help, how to make ugly button border disappear when click on?

相关标签:
14条回答
  • 2020-12-02 09:38

    It's greatly simple than you think. When the button is focussed, apply the outline property, like this:

    button:focus {
        outline: 0 !important;
    }
    

    But when I use none value, it doesn't work for me.

    0 讨论(0)
  • 2020-12-02 09:39

    Removing nessorry accessible event not a good idea in up to standard web developments. either way if you looking for a solution removing just the outline doesn't solve the problem. you also have to remove the blue color shadow. for specific scenarios use a separate class name to isolate the this special style to your button.

    .btn.focus, .btn:focus {
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
    }
    

    Better do this

    .remove-border.focus, .remove-border:focus {
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
     }
    
    0 讨论(0)
提交回复
热议问题