zoukankan      html  css  js  c++  java
  • 去掉谷歌自动填充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">
    与尘埃中开出花朵。
  • 相关阅读:
    Java运行环境(win10)
    maven封装jar包遇到的问题
    eclipse安装STS遇到的问题
    Redis IO多路复用的理解
    操作系统文章推荐
    jdk1.8新特性
    Maven笔记
    博主推荐
    MySQL文章推荐
    多线程文章推荐
  • 原文地址:https://www.cnblogs.com/congfeicong/p/7545897.html
Copyright © 2011-2022 走看看