去掉谷歌自动填充input内容

网页中的表单,chrome会默认给自动填充的input表单加上input:-webkit-autofill私有属性

就会变成:

input:-webkit-autofill {
    background-color: #FAFFBD;
    background-image: none;
    color: #000;
}

 

1、纯色背景(添加内阴影)

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    border: 1px solid #CCC!important;
}

2、不是纯色背景(添加一个display:none的input框,将name取成和使用的input的name一样)

<span style="font-size:14px;">
    <input type="text" name="demo1" style="display: none">  
    <input type="text" name="demo1"  autocomplete="off" >
</span>

 3、当input是passworde时,记住密码之后,所有地方的input都会自动填充。(加上autocomplete="new-password")

<input type="password" class="form-control" autocomplete = 'new-password' name="password" id="password" required>

 

<input type="text" class="form-control" name="user_email" id="user_email" onmouseenter="$(this).attr('readonly',false)" onmouseleave="$(this).attr('readonly',true)" readonly="readonly" autocomplete="email">

转载于:https://www.cnblogs.com/congfeicong/p/7545897.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值