美文网首页
input placeholder属性 样式修改(颜色,大小,位

input placeholder属性 样式修改(颜色,大小,位

作者: 林ze宏 | 来源:发表于2018-01-30 14:56 被阅读0次
<!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>

备注:

::-webkit-input-placeholder { /* WebKit, Blink, Edge */
    color:    #909;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   color:    #909;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
   color:    #909;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
   color:    #909;
}

相关文章

网友评论

      本文标题:input placeholder属性 样式修改(颜色,大小,位

      本文链接:https://www.haomeiwen.com/subject/kjrczxtx.html