码迷,mamicode.com
首页 > 其他好文 > 详细

常用 更改input的placeholder颜色和滚动条样式更改

时间:2018-03-21 17:26:46      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:textarea   更改   rgba   rac   padding   web   样式   position   absolute   

/*更改input的placeholder颜色*/
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {

    color:#CCCCCC;
}
input:-moz-placeholder, textarea:-moz-placeholder {
    color:    #CCCCCC;
}
input::-moz-placeholder, textarea::-moz-placeholder {
    color:    #CCCCCC;
}
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
    color:    #CCCCCC;
}

/*滚动条样式*/
ul::-webkit-scrollbar-track-piece,div::-webkit-scrollbar-track-piece {
    background-color: rgba(0, 0, 0, 0);
    border-left: 1px solid rgba(0, 0, 0, 0);
}
ul::-webkit-scrollbar,div::-webkit-scrollbar {
    width: .05rem;
    height: .1rem;
    -webkit-border-radius: .08rem;
    -moz-border-radius: .08rem;
    border-radius: .08rem;
}
ul::-webkit-scrollbar-thumb,div::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5);
    background-clip: padding-box;
    -webkit-border-radius: .08rem;
    -moz-border-radius: .08rem;
    border-radius: .08rem;
    min-height: 28px;
}
ul::-webkit-scrollbar-thumb:hover,div::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-border-radius: .08rem;
    -moz-border-radius: .08rem;
    border-radius: .08rem;
}
/*单选按钮*/
input[type="radio"]+span::before {
    content: "\a0"; /*不换行空格*/
    display: inline-block;
    vertical-align: middle;
    font-size: .12rem;
    width: .22rem;
    height: .22rem;
    margin-right: .1rem;
    border-radius: 50%;
    border: 1px solid #CCCCCC;
    text-indent: .15rem;
    line-height: 1;
    margin-top: -.05rem;
}
input[type="radio"]:checked + span::before {
    background-color: #186DC8;
    background-clip: content-box;
    padding: .02rem;
    width: .16rem;
    height: .16rem;
}
input[type="radio"] {
    position: absolute;
    clip: rect(0, 0, 0, 0);
}

 

常用 更改input的placeholder颜色和滚动条样式更改

标签:textarea   更改   rgba   rac   padding   web   样式   position   absolute   

原文地址:https://www.cnblogs.com/yuan619821/p/8618104.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!