Remove Safari/Chrome textinput/textarea glow

后端 未结 13 940

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

    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;
    }
    

    Update: You may not have to use the :focus selector. If you have an element, say

    stuff
    , and you were getting the outer glow on this div element, just apply like normal:

    #mydiv {
      outline-color: transparent;
      outline-style: none;
    }
    

提交回复
热议问题