Remove Safari/Chrome textinput/textarea glow

后端 未结 13 915

I am wondering if its possible to remove the default blue and yellow glow when I click on a text input / text area using CSS?

13条回答
  •  时光取名叫无心
    2020-11-28 18:27

    This is the solution for people that do care about accessibility.

    Please, don't use outline:none; for disabling the focus outline. You are killing accessibility of the web if you do this. There is a accessible way of doing this.

    Check out this article that I've written to explain how to remove the border in an accessible way.

    The idea in short is to only show the outline border when we detect a keyboard user. Once a user starts using his mouse we disable the outline. As a result you get the best of the two.

提交回复
热议问题