闲聊:

小颖项目中的登录页需将  input  背景色设为透明,小颖将 input  的背景色设置后,发现表单自动填充后还是会有背景色,然后发现 浏览器 自带了背景色:

效果图:

                 

虽然小颖也设置了其背景色为透明,但表单自动填充后还是有背景色,问度娘后解决了。

解决方案:

  .el-input {
height: 46px;
background: url(("../assets/largeS/login_input.png"));
background-size: 100% 100%;
.el-input-group__prepend,
.el-input__inner,
.el-input__inner:hover,
.el-input__inner:focus {
background-color: transparent !important;
border-width: 0;
}
// 解决回填后带背景色问题
.el-input__inner:-webkit-autofill,
.el-input__inner:-webkit-autofill:hover,
.el-input__inner:-webkit-autofill:focus,
.el-input__inner:-webkit-autofill:active {
-webkit-transition-delay: 99999s;
-webkit-transition: color 99999s ease-out,
background-color 99999s ease-out;
}
input {
height: 46px;
box-shadow: inset 0 0 0 1000px transparent !important;
}
.user_icon {
width: 24px;
height: 22px;
display: inline-block;
margin-top: 8px;
background: url(("../assets/largeS/login_user.png"));
}
.password_icon {
width: 19px;
height: 23px;
display: inline-block;
margin-top: 8px;
background: url(("../assets/largeS/login_pwd.png"));
}
}

参考:

chrome浏览器中自带input样式input:-internal-autofill-selected(修改input背景色)

表单信息:

    <div class="form_box">
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">欢迎登录</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<span slot="prepend" class="user_icon"></span>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<span slot="prepend" class="password_icon"></span>
</el-input>
</el-form-item>
<el-form-item style="width: 100%">
<el-button
:loading="loading"
size="medium"
type="primary"
class="login_btn"
@click.native.prevent="handleLogin"
>
<span v-if="!loading" style="font-size: 16px">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
<div style="float: right" v-if="register">
<router-link class="link-type" :to="'/register'"
>立即注册</router-link
>
</div>
</el-form-item>
</el-form>
</div>

  

css零散笔记——修改input样式input:-internal-autofill-selected背景色的更多相关文章

  1. CSS 小结笔记之三种样式表

    CSS 引入共有三种方式:内部样式表,内联样式(行内样式)表,外部样式表,当然也可以使用多重样式 内联样式 <div style="color:red;font-size:20px&q ...

  2. CSS如何修改placeholder样式

    项目用经常遇到修改input的placeholder的颜色的需求,这里来看一下placeholder如何用css设置: 原文发布与我的个人博客>> 首先来看一下chrome默认的input ...

  3. [CSS] input样式定制

    input样式 定制一个泥团input,想怎么捏就怎么捏 appearance: none 所有主流浏览器都不支持 appearance 属性. Firefox 支持替代的 -moz-appearan ...

  4. React 项目中修改 Ant Design 的默认样式(Input Checkbox 等等

    修改样式更符合项目的需求特别是在 Input 和 Checkbox 等等一系列 试过很的方式都有问题, 比如直接在行内添加样式会无法传递到特定的层级 最好的办法是添加 id 可行 渲染部分代码 < ...

  5. HTML+CSS学习笔记 (7) - CSS样式基本知识

    HTML+CSS学习笔记 (7) - CSS样式基本知识 内联式css样式,直接写在现有的HTML标签中 CSS样式可以写在哪些地方呢?从CSS 样式代码插入的形式来看基本可以分为以下3种:内联式.嵌 ...

  6. css实现 当鼠标移到input的时候,input框出现阴影,当移动到button的时候,input框的阴影消失,button框出现阴影

    <meta charset="utf-8" /> <style type="text/css"> div{overflow: hidde ...

  7. 使用jquery修改css中带有!important的样式属性

    当CSS中含有!important的样式属性时,普通的修改方式是会出现失败的.如下: <div class="test">使用jquery修改css中带有!import ...

  8. html中如何修改选中 用input做的搜索框 的边框颜色

    html中如何修改选中 用input做的搜索框 的边框颜色 如图,当我鼠标选中输入框时,内边框会变成蓝色 我的问题是: 1.如何把蓝色去掉? 2.如何改成别的颜色? 首先感谢 UI设计师提出的需求,解 ...

  9. 如何利用 jQuery 修改 css 中带有 !important 的样式属性?

    使用 jQuery 修改 css 中带有 !important 的样式属性 外部样式为: div.test { width:auto !important; overflow:auto !import ...

  10. 自定义带图标input样式

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

随机推荐

  1. 银河麒麟等 Linux系统 安装 .net 5,net 6及更高版本的方法

    最近项目上用到 银河麒麟的操作系统,需要搭建 .net 跨平台方案.一开始使用各种命令都安装不上,很多提示命令找不到,或者下载包时候网络无法下载. 网上教程很多,但没有一个是成功的,多数使用 apt ...

  2. 从浅入深了解.NET Core MVC 2.x全面教程【第二章】

    二.Logging 1.诊断中间件 命名空间:Microsoft.AspNetCore.Diagnostics 报告信息并处理异常 2.诊断中间件 UseDeveloperExceptionPage: ...

  3. SimpleDateFormat 线程安全问题修复方案

    问题介绍 在日常的开发过程中,我们不可避免地会使用到 JDK8 之前的 Date 类,在格式化日期或解析日期时就需要用到 SimpleDateFormat 类,但由于该类并不是线程安全的,所以我们常发 ...

  4. 使用 OpenTelemetry 构建 .NET 应用可观测性(1):什么是可观测性

    目录 什么是系统的可观测性(Observability) 为什么需要软件系统需要可观测性 可观测性的三大支柱 日志(Logging) 指标(Metrics) 分布式追踪(Distributed Tra ...

  5. iOS添加图片

    添加一个按钮 将图片添加到

  6. RK3568开发笔记(七):在宿主机ubuntu上搭建Qt交叉编译开发环境,编译一个Demo,目标板运行Demo测试

    前言   在之前的博文中已经搭建好了一个比较完善的ubuntu宿主机,都很完善了但是发现没有Qt交叉编译开发环境,所以还需要搭建一套Qt交叉编译开发环境.   补充说明   本篇是基于<RK35 ...

  7. LeetCode买卖股票之一:基本套路(122)

    欢迎访问我的GitHub 这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos 关于<LeetCode买卖股票>系列 在L ...

  8. 谈谈JSF业务线程池的大小配置

    1.简介 JSF业务线程池使用JDK的线程池技术,缺省情况下采用Cached模式(核心线程数20,最大线程数200).此外,还提供了Fixed固定线程大小的模式,两种模式均可设置请求队列大小. 本文旨 ...

  9. Python socket实现简单聊天,同步输入和接收消息

    查的资料很多都是必须等待接收数据后才能再次输入.做了修改,使用多线程的形式,实现一边输入,一边接收 服务端代码 import socket import threading import sys im ...

  10. 每天5分钟复习OpenStack(四) virsh 常用命令

    在上一章节中,我们拉起了第一台虚拟机,但是执行virsh shutdown 关机是无法关机的,需要使用virsh destroy 强制断电的命令来关机.为什么会这样了? 这里我们介绍下 QGA的概念 ...