会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
niunf
博客园
首页
博问
闪存
新随笔
订阅
管理
去掉谷歌浏览器输入框的默认黄色背景
谷歌浏览器登录记住密码后 下次登录会自动填充,并且有黄色背景。
谷歌浏览器的设置如下:
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
rgb(250, 255, 189);
background-image:
none;
color:
rgb(0, 0, 0);
}
去掉黄色背景第一种方法是对它重写样式,使用!important提升优先级,除了chrome默认定义的background-color,background-image,color不能用!important提升其优先级以外,其他的属性均可使用!important提升其优先级。
input
:
-webkit-autofill
{
-webkit-box-shadow
:
0
0
0px
1000px
white inset
; //使用足够大的纯色内阴影覆盖黄色背景
border
:
1px
solid
#CCC
!important
;
}
试了上面的方法,如果input内有图片,
会将前面的图标一起遮罩。
posted on
2018-04-19 15:26
niunf
阅读(
279
) 评论(
0
)
编辑
收藏
举报
刷新页面
返回顶部