浏览器在网页中识别到一个表单的字段时,提供一个允许用户自动填充的功能。如图。
由于黄色的背景,在很多情况下会与我们的网页配色格格不入。 所以。我们自定义下自动填充样式。
###解决方案
:-webkit-autofill,
:-webkit-autofill:hour,
:-webkit-autofill:focus {
borrder:none;
-webkit-text-fill-color: #000; //自定义字体的颜色
-webkit-box-shadow: 0 0 0px 1000px #fff inset; //背景色
transition: backgroud-color 5000s ease-in-out 0s;
font-weight: 500;
}
复制代码