[HTML] Change an HTML5 input's placeholder color with CSS

web开发作者:dayu日期:10天前点击:5

We will look at what CSS selectors to use to change an HTML5 inputs placeholder color. This can differ from browser to browser, so, we will make sure to cover all of the cases.

/* Chrome, Opera, Safari */
  ::-webkit-input-placeholder {
    color: #ff6600;
    opacity: 1;
  }
  /* Firefox 19+ */
  ::-moz-placeholder {
    color: #ff6600;
    opacity: 1;
  }
  /* Firefox 18 and below */
  :-moz-placeholder {
    color: #ff6600;
    opacity: 1;
  }
  /* MS IE 10+ */
  :-ms-input-placeholder {
    color: #ff6600;
    opacity: 1;
  }

[HTML] Change an HTML5 input's placeholder color with CSS

原文地址:http://www.cnblogs.com/Answer1215/p/7214333.html


下一篇       上一篇