How to remove focus around buttons on click

后端 未结 30 1076
遇见更好的自我
遇见更好的自我 2020-12-02 04:24

My buttons all have a highlight around them after I click them. This is in Chrome.

\"Unselected\"

30条回答
  •  借酒劲吻你
    2020-12-02 05:02

    If you're using a webkit browser (and potentially a browser compatible with webkit vendor prefixing), that outline belongs to the button's -webkit-focus-ring pseudoclass. Simply set it's outline to none:

    *:-webkit-focus-ring {
      outline: none;
    }
    

    Chrome is such a webkit browser, and this effect happens on Linux too (not just a macOS thing, although some Chrome styles are macOS only)

提交回复
热议问题