Where to find input placeholder style

前端 未结 4 1543
[愿得一人]
[愿得一人] 2021-01-17 20:34

Couldn\'t find default placeholder style for input element. There are no any webkit-input-placeholder, -moz-placeholder, -moz-placeholder

4条回答
  •  梦谈多话
    2021-01-17 20:42

    Webkit's User Agent Stylesheet (Chrome & Safari) can be found here: http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css

    Their CSS shows:

    ::placeholder {
      -webkit-text-security: none;
       color: darkGray;
      pointer-events: none !important;
    }
    
    input::placeholder, isindex::placeholder {
      white-space: pre;
      word-wrap: normal;
      overflow: hidden;
    }
    

    I can't find any other sources that have the defaults for other browsers, but I imagine they would be close to this.

提交回复
热议问题