闲聊:

小颖项目中的登录页需将  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. 【工具】-Reverse-DIE(Detect-It-Easy)

    关于 Detect It Easy,或缩写为"DIE"是一个用于确定文件类型的程序.Detect It Easy 是一个多功能的 PE 检测工具,基于 QT 平台编写,主要用于 P ...

  2. 树莓派烧录系统并在无外接屏幕的情况下连接VNC

    ​ 上个月老板给了块树莓派3B,开心坏了,在咸鱼上掏了很多零件,花了一段时间做出了一个二驱动的智能小车,但是觉得小车太小,就在又在咸鱼上掏了个四区的地盘,但是在拆卸的过程中,发现树莓派WIFI没有了, ...

  3. 【pandas小技巧】--列值的映射

    映射列值是指将一个列中的某些特定值映射为另外一些值,常用于数据清洗和转换. 使用映射列值的场景有很多,以下是几种常见的场景: 将字符串类型的列中的某些值映射为数字.例如,将"男"和 ...

  4. 如何在linux上安装neovim0.9(以debian和ubuntu为例) – 东凭渭水流

    发布于 1 分钟前  3 次阅读 由于apt中只有neovim-0.72的安装包.想使用新版需要自己安装,以下是安装过程 1.首先需要卸载旧版neovim sudo remove neovim 2.从 ...

  5. vue3探索——组件通信之事件总线

    Vue2.x使用EventBus进行组件通信,而Vue3.x推荐使用mitt.js. 比起Vue实例上的EventBus,mitt.js好在哪里呢?首先它足够小,仅有200bytes,其次支持全部事件 ...

  6. 反汇编ARM程序的技术靠谱吗?——揭秘ARM架构二进制程序的反汇编技术现状

    ​  本文系原创,转载请说明出处 Please Subscribe Wechat Official Account:信安科研人,获取更多的原创安全资讯 参考发表在2020年软工顶会ISSTA的论文&l ...

  7. 《SQL与数据库基础》17. InnoDB引擎

    目录 InnoDB引擎 逻辑存储结构 架构 内存结构 磁盘结构 后台线程 事务原理 事务基础 redo log undo log MVCC 基本概念 隐式字段 undo log版本链 readView ...

  8. from itertools import groupby

    需求:期望由 a 得到 b 实现方法: from itertools import groupby a = [ {'name': 'a', 'value': 1}, {'name': 'b', 'va ...

  9. Teamcenter RAC 开发之《PlaceHolder》

    背景 做个swing表单,有时候想实现一些网页input标签的placeHolder提示,可能本人写vue or html写多,对某些细节有强迫症,所以找小下资料 实现方法(Swingx) 看源码

  10. python第6章code

    01条件判断语句 # 条件判断语句(if语句)# 语法:if 条件表达式 : # 代码块# 执行的流程:if语句在执行时,会先对条件表达式进行求值判断,# 如果为True,则执行if后的语句# 如果为 ...