Styling input placeholder (default and focus state) in Chrome 42

This question already has an answer here:

  • Change an HTML5 input's placeholder color with CSS 31 answers

  • If you have a list of comma seperated selectors like that and a browser doesn't recognise even one of those selectors it will ignore all selectors in that list.

    In your example, the -moz prefix for Firefox will not be recognised by Chrome.

    The fix is to create separate rules for each different prefix.


    我认为这个代码将起作用:

    input[type="text"]::-webkit-input-placeholder {
       color: #fff;
    }
    
    链接地址: http://www.djcxy.com/p/12170.html

    上一篇: 点击事件如何更改占位符颜色?

    下一篇: 在Chrome 42中为输入占位符(默认和焦点状态)设置样式