html - 地址自动填充时如何更改输入字段样式
问题描述
我已经在我的 chrome 浏览器中存储了地址,所以当我填写表格时,我会看到这样的弹出窗口:
如何更改 CSS,以使输入字段不会变蓝。我已经尝试了下面的代码,但没有奏效:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
background-color: transparent;
}
解决方案
当您选择自动填充建议时,您无法进行透明输入,但您可以在自动填充建议后使用以下 CSS 更改输入字段的颜色:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 30px white inset !important;
}
您可以更改自动填充建议的文本颜色:
input:-webkit-autofill {
-webkit-text-fill-color: yellow !important;
}
推荐阅读
- javascript - 用户名和密码的 JavaScript 验证
- google-cloud-run - 通过构建包使用云构建设置持续部署
- python - 如何处理列表索引超出范围?
- vue.js - 运行“npm run build”时生成 web.config 文件
- amazon-cognito - 如何检查 Cognito 用户 admin-set-user-mfa-preference 值
- javascript - 使用JS设置div的高度以匹配另一个div的底部位置
- node.js - passport-github2 在电子邮件字段中返回 null
- laravel - Laravel V4.1.0:401 代码“消息”:“未验证”。用于 API
- java - 如何将不同的类对象添加到 ArrayList
- mysql - 如果后面的记录符合条件,则返回 id 的结果