input 修改placeholder中颜色和字体大小

1.style中需要作如下修改:

<style>
 
input::-webkit-input-placeholder {
    /* placeholder颜色 */
    color: #aab2bd;
    /* placeholder字体大小 */
    font-size: 12px;
}
</style>

2.HTML中的代码如下:

<input type="text" placeholder="输入你想要查找的内容" id="groupName">

3.同理textarea改变字体的大小和颜色方式:

style:

textarea::-webkit-input-placeholder {
  /* WebKit browsers */
  color: #9c9c9c;
}
textarea:-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  color: #9c9c9c;
}
textarea::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  color: #9c9c9c;
}
textarea::-ms-input-placeholder {
  /* Internet Explorer 10+ */
  color: #9c9c9c;
 
}
原文地址:https://www.cnblogs.com/art-poet/p/13570409.html