Chrome 下input的默认样式

一.去除默认边框以及padding

border: none;
padding:0

 

二.去除聚焦蓝色边框

    outline: none;

 

三.form表单自动填充变色

1.给input设置内置阴影,至少要比你的input本身大。不过,box-shadow是很慢的,适当大小。而且,如果你的input是用图片做背景的话,是没有办法做这么干的。设置transparent也不可以。

input:-webkit-autofill,
    textarea:-webkit-autofill,
    select:-webkit-autofill {
        -webkit-box-shadow: 0 0 0 100px white inset; //通过内阴影覆盖默认黄色背景
        -webkit-text-fill-color: #333;               //去除默认黑色字色
}

 

2.关闭自动补全

<input type="text"  autocomplete="off">

 

3.设置背景变换过渡,可短时间内保持原本背景(支持透明)

 

transition: background-color 5000s ease-in-out 0s; 

 

 

 

 

 四.改变placeholder样式

input::-webkit-input-placeholder{color:rgba(0,0,0,0.3);}
input::-moz-input-placeholder{color:rgba(0,0,0,0.3);}
input::-ms-input-placeholder{color:rgba(0,0,0,0.3);}
input::-o-input-placeholder{color:rgba(0,0,0,0.3);}

 

转载于:https://www.cnblogs.com/coderL/p/7803917.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值