css - 谷歌浏览器自动填充背景颜色变化?
问题描述
我正在尝试更改输入的自动填充背景颜色。
网上接受的答案似乎是这样的:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
input:-internal-autofill-selected,
input:-internal-autofill-previewed {
background-color: white !important;
-webkit-box-shadow: 0 0 0 30px white inset !important;
}
这似乎在一种情况下可以接受,即字段已经自动填充。
这意味着我刷新浏览器并且这些字段已经预先填充了用户名/密码。
当我将鼠标悬停在或单击输入时,背景颜色会发生变化。但是,当我什么都不做时box-shadow
,它仍然设置为默认值user agent stylesheet
。
input:-internal-autofill-selected {
background-color: rgb(232, 240, 254) !important;
background-image: none !important;
color: rgb(0, 0, 0) !important;
}
我也尝试了一些随机属性,但没有成功。
input:-internal-autofill,
input:-internal-autofill:hover,
input:-internal-autofill:focus,
input:-internal-autofill:active,
Chrome 版本 77.0.3865.90(官方版本)(64 位)
根本不知道如何覆盖它。就像它被添加到 css 规则的底部一样important
无法覆盖?
解决方案
推荐阅读
- reactjs - 如何传递属性,使用下一个 JS?
- sql - MS Access:确定 4 列中的第二高值
- composer-php - Swiftmailer“基本用法”导致未捕获的 ArgumentCountError:参数太少
- python - cv2.imshow() 无法正确显示图像
- python - 用于 Python 的 MySQL 连接器抛出“在查询期间丢失与 MySQL 服务器的连接”
- c# - 将 C# Blazor 应用程序部署到 AzureWebSites,但索引是常规 HTML 页面
- html - 为什么我的 Materialize Select 不起作用,即使我复制了代码?
- javascript - 性能问题 Nuxt.js
- influxdb - influxdb 连续查询将数据移动到保留策略,选择具有许多转换的多个值
- java - 如何获取 SurfaceView 的 Surface