input placeholder属性 样式修改(颜色,大小,位置)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> input::-webkit-input-placeholder { /* placeholder颜色 */ color: #aab2bd; /* placeholder字体大小 */ font-size: 12px; /* placeholder位置 */ text-align: right; } input { border: 1px solid red; } </style> </head> <body> <input type="text" placeholder="请输入手机号"> </body> </html>
input::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #909; } input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #909; } input::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #909; } input:-ms-input-placeholder { /* Internet Explorer 10-11 */ color: #909; }