css 修改input输入框属性

1.修改输入框颜色背景色等

input[type=text] {
    width: 340px;
    padding: 0 25px;
    height: 48px;
    border: 1px solid #f2f2f2;
    background: #f6f6f6;
    color: #202124;
    font-size: 14px;
    line-height: 48px;
    border-radius: 25px;
}

2.修改输入框选中时的边框颜色及背景色

input[type=text]:focus { 
    outline: none;
    border-color: #2ca63b;
    background-color: #fff;
 }
input[type=text]::selection{
    background:transparent;
    background-color: #fff;
}
input[type=text]::-moz-selection{
    background:transparent;
    background-color: #fff;
}

3.修改placeholder颜色

input[type=text]::-webkit-input-placeholder { /* WebKit browsers */
    color: #bababa;
}
input[type=text]:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color: #bababa;
}
input[type=text]::-moz-placeholder { /* Mozilla Firefox 19+ */
    color: #bababa;
}
input[type=text]:-ms-input-placeholder { /* Internet Explorer 10+ */
    color: #bababa;
}

 

posted @ 2019-01-02 10:02  雾以泪聚rx  阅读(20957)  评论(0编辑  收藏  举报