去除输入框input的缓存提示、自动填充

1.input框的缓存提示

input的缓存提示

清除方法:

  1. 在不想使用缓存的input中添加 autocomplete=“off”;
  2. 在 input 所在的form标签中添加 autocomplete=“off”;
2.input框的自动填充

input的自动填充

当“密码”那项input的type改成password的时候
chrome浏览器对type="password"进行了识别,并把"密码"项进行了填充,并且把"密码"项前面input当成了"账号"项进行了填充

  1. 去除自动填充解决办法是,添加两个隐藏的input框,第二个type为password
<label style="display:none;"><span></span><input type="text" name="hidden1" ></label>
<label style="display:none;"><span></span><input type="password" name="hidden2" ></label>
  1. 修改填充背景颜色
input[type="text"] {
    border: 1px solid #333333 !important;
    padding: 0px 12px 0px 32px;
    background: transparent !important;
}
input[type="password"] {
    border: 1px solid #333333 !important;
    padding: 0px 12px 0px 32px;
    background: transparent !important;
}

@-webkit-keyframes autofill {
    to {
        color: #666;
        background: transparent;
    }
}

input:-webkit-autofill {
    animation-name: autofill !important;
    animation-fill-mode: both !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    background-clip: content-box !important;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值