Pum*_*ath 2 css google-chrome autocomplete background-color
我正在制作一个表单,希望每个输入都具有透明性,但是当我在Chrome中使用自动完成功能,然后使用Tab键进入下一个字段时,上一个字段会变成浅蓝色背景。
我试过使用:
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 30px white inset !important;
transition: background-color 5000s ease-in-out 0s;
}
Run Code Online (Sandbox Code Playgroud)
但这不起作用。我不希望白色背景在单击另一个输入时将其保持透明,并且将设置color为transparent也不起作用。
如何做到这一点?
Google似乎对shadow属性做了一些魔术。这使它对我有用:
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 {
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1701 次 |
| 最近记录: |