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">
    与尘埃中开出花朵。
  • 相关阅读:
    chrome、firefox、IE中input输入光标位置错位解决方案
    IE兼容opacity
    Linux下redis5的安装及伪分布式集群搭建
    Linux文件编辑命令详细整理
    saltstack
    redis集群
    系统调优
    centos7 telnet 登录升级ssh
    keepalive简单高可用 ha
    docker
  • 原文地址:https://www.cnblogs.com/congfeicong/p/7545897.html
Copyright © 2011-2022 走看看