问题描述
当我尝试选择浏览器在输入字段中保存的选项时,我遇到了角度材料问题。
如您所见,文本周围有一个白色矩形。有没有办法删除它并使文本没有它出现?
解决方法
请尝试以下操作。
::ng-deep input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active {
transition: background-color 5000s ease-in-out 0s;
-webkit-text-fill-color: black;
}
input:-webkit-autofill 是您需要用来“覆盖”由“webkit”自动应用的用户代理样式的选择器。
然而,似乎被“窃听”,因为它不接受背景颜色:透明,所以我使用的技巧是通过这种方式创建过渡。