Remove Safari/Chrome textinput/textarea glow

后端 未结 13 936

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:28

    Carl W:

    This effect can occur on non-input elements, too. I've found the following works as a more general solution

    :focus {
      outline-color: transparent;
      outline-style: none;
    }
    

    I’ll explain this:

    • :focus means it styles the elements that are in focus. So we are styling the elements in focus.
    • outline-color: transparent; means that the blue glow is transparent.
    • outline-style: none; does the same thing.

提交回复
热议问题